c=0 for _ in '1'*1000: N,K=map(int,input().split()) if (N-1)%(K+1)!=0:c+=1 print(c)