import sys
import math

input = sys.stdin.buffer.readline

X = int(input())
Y = int(input())
L = int(input())

cnt = 0
if Y < 0:
    cnt += 2
elif Y >= 0 and X != 0:
    cnt += 1
    
X, Y = map(abs, [X, Y])
cnt += X // L + 1 if X % L != 0 else X // L
cnt += Y // L + 1 if Y % L != 0 else Y // L
print(cnt)