# -*- coding: utf-8 -*- x = int(input()) y = int(input()) l = int(input()) rotation = 0 if x != 0 and y > 0: rotation = 1 elif x == 0 and y > 0: rotation = 0 elif x != 0 and y == 0: rotation = 1 elif x == 0 and y == 0: rotation = 0 elif x != 0 and y < 0: rotation = 2 elif x == 0 and y < 0: rotation = 2 x_num = 0 y_num = 0 x = abs(x) y = abs(y) if x % l == 0: x_num = int(x / l) else: x_num = x // l + 1 if y % l == 0: y_num = int(y / l) else: y_num = y // l + 1 print(x_num + y_num + rotation)