x = int(input()) y = int(input()) l = int(input()) x_ti = abs(x) // l if x % l == 0 else abs(x) // l + 1 y_ti = abs(x) // l if y % l == 0 else abs(y) // l + 1 if y > 0: if x != 0: a = 1 else: a = 2 print(x_ti + y_ti + a)