X=int(input()) Y=int(input()) L=int(input()) shift=0 def xset(x): global X,shift if x == 0: X = 0 elif x%L == 0: shift += 1 X = int(abs(x)/L) elif x%L != 0: shift += 1 X = int(abs(x)/L)+1 return X if Y == 0: xset(X) elif Y > 0: if Y%L == 0: Y = int(abs(Y)/L) xset(X) else: Y = int(abs(Y)/L)+1 xset(X) elif Y < 0: if Y%L == 0: xset(X) if X == 0: shift += 2 else: shift += 1 Y = int(abs(Y)/L) else: xset(X) if X == 0: shift += 2 else: shift += 1 Y = int(abs(Y)/L)+1 print(X+Y+shift)