import math

x = int(input())
y = int(input())
l = int(input())
res = 0

# 方向転換の分
if y < 0 :
    y *= -1
    if x == 0 :
        res += 2
    else:
        res += 1
        
if x > 0 :
    res += 1
elif x < 0 :
    res += 1
    x *= -1


# 移動距離の分
res += math.ceil( x / l )
res += math.ceil( y / l )

print(res)