X = int(input()) Y = int(input()) L = int(input()) k = 2 if Y < 0 else (X!=0) x = abs(X)//L + (X%L > 0) y = abs(Y)//L + (Y%L > 0) print(x + y + k)