import math X = int(input()) Y = int(input()) L = int(input()) x = math.ceil(abs(X)/L) y = math.ceil(abs(Y)/L) if X != 0 and Y > 0: r = 1 elif Y < 0: r = 2 elif X == 0 and Y >= 0: r = 0 elif X != 0 and Y == 0: r = 1 print(x+y+r)