def main(): x = int(input()) y = int(input()) max_length = int(input()) if x == 0 and y > 0: operation = 0 elif y < 0: operation = 2 else: operation = 1 x = abs(x) y = abs(y) operation += x // max_length + (0 if x % max_length == 0 else 1) operation += y // max_length + (0 if x % max_length == 0 else 1) print(operation) if __name__ == '__main__': main()