X = int(input()) Y = int(input()) L = int(input()) N = (abs(X)-1) // L + (abs(Y)-1) // L + 2 if X<0: print(N+1) else:print(N)