l,r,n=map(int,input().split()) v=(r-l+1)//n-1 for i in range(n): tmp=v if l%n<=i: tmp+=1 if r!=l and 0<=i<=r%n: tmp+=1 print(tmp)