x = abs(int(input())) y = abs(int(input())) step = int(input()) count = 1 if x%step == 0: count += x/step else: count += int(x/step) + 1 if y%step == 0: count += y/step else: count += int(y/step) + 1 print(int(count))