x = int(input()) y = int(input()) z = int(input()) c = 0 if y < 0 : c += 2 elif x != 0 : c += 1 c += abs(x) // z + (x % z != 0) c += abs(y) // z + (y % z != 0) print(c)