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