x = int(input())
y = int(input())
L = int(input())

res = 0
if y >= 0:
    if x != 0:
        res += 1
else:
    res += 2

res += abs(x) // L
if abs(x) % L >= 1:
    res += 1
res += abs(y) // L
if abs(y) % L >= 1:
    res += 1

print(res)