def movetime(x, max): tmp = x / max if x % max != 0: tmp += 1 return tmp x = int(raw_input()) y = int(raw_input()) max = int(raw_input()) cnt = movetime(y, max) if x != 0: cnt += movetime(x, max) + 1 print cnt