x = int(input()) y = int(input()) z = int(input()) c = abs(x) // z + (x % z != 0) c += x != 0 and y != 0 c += abs(y) // z + (y % z != 0) print(c)