#ロボットの操縦 X = abs(int(input())) Y = abs(int(input())) L = int(input()) count = X // L + min(X % L , 1) count += Y // L + min(Y % L , 1) if Y >= 0 and X != 0: count += 1 elif Y < 0: count += 2 print(count)