import math x = int(input()) y = int(input()) c = int(input()) cou = 0 if y >= 0 and x == 0: cou += 0 elif y >= 0 and x != 0: cou += 1 elif y < 0: cou += 2 a = math.ceil((abs(x)+abs(y))/c) print(a+cou)