X = abs(int(input())) Y = abs(int(input())) L = int(input()) count = X // L if X % L == 0 else X//L + 1 if Y != 0: count += 1 count += Y // L if Y % L == 0 else Y//L + 1 print(count)