X = int(input()) Y = int(input()) L = int(input()) T = 0 A = abs(X // L) B = abs(Y // L) if not X % L == 0: A += 1 if not Y % L == 0: B += 1 if Y < 0: T += 2 elif X == 0: pass else: T += 1 print(T + A + B)