X = abs(int(input())) Y = abs(int(input())) L = int(input()) A = -(-X // L) B = -(-Y // L) print(A + B + (1 if A * B > 0 else 0))