X = int(input()) Y = int(input()) L = int(input()) step = 0 if((X >= 0) and (Y > 0)): step += 1 elif((X >= 0) and (Y < 0)): step += 2 Y *= -1 elif((X < 0) and (Y > 0)): step += 1 X *= -1 elif((X < 0) and (Y < 0)): step += 2 X *= -1 Y *= -1 step += int(X/L) if((X % L) != 0): step += 1 step += int(Y/L) if((Y % L) != 0): step += 1 print(step)