X = int(input())
Y = int(input())
L = int(input())
rota = 0
gost = 0
if Y > 0:
    if X != 0:
        rota += 1
elif Y == 0:
    if X != 0:
        rota += 1
else:
    if X == 0:
        rota += 2
    else:
        rota += 2
        
if X % L == 0:
    gost += abs(X // L)
else:
    gost += abs(X // L) + 1
if Y % L == 0:
    gost += abs(Y //L)
else:
    gost += abs(Y //L) + 1
   
print(rota+gost)    
print('\n')