import math X = int(input()) Y = int(input()) L = int(input()) action = 0 #rotation if Y < 0: action += 2 elif X != 0: action += 1 #advance action += abs(math.ceil(X/L)) + abs(math.ceil(Y/L)) print(action)