import math i=input X,Y,W = map(int,[i(),i(),i()]) cd = 0 if X < 0: cd = 3 elif Y < 0: cd = 2 elif X > 0: cd = 1 print(cd + int(math.ceil(abs(X)/W)) + int(math.ceil(abs(Y)/W)))