import math x = input() y = input() l = input() turn = 0 x = int(x) y = int(y) l = int(l) if int(x) >= 0: if int(y) != 0: turn = 1 else: turn = 0 else: turn = 2 print(math.ceil(abs(x)/l)+math.ceil(abs(y)/l)+turn)