x=int(input()) y=int(input()) l=int(input()) count=0 if x!=0: count +=1 if y<0 and x==0: count +=2 elif y<0: count+=1 print((-(-abs(y)//l)) + (-(-abs(x)//l)) +count)