a pig can&#39;t sleep so count many sheeps