x=int(input()) y=int(input()) l=int(input()) ans=0 if y>=0: if x!=0: ans+=1 else: ans+=2 print(ans+(abs(x)+l-1)//l+(abs(y)+l-1)//l)