counts until N