x=int(input()) y=int(input()) l=int(input()) r=-(-x//l)-(-y//l) if y<0:r+=2+(x<0) else:r+=(x>0)+(x<0)*3 print(r)