import math X = int(input()) # 移動先の東西軸座標 正の方向を東 Y = int(input()) # 移動先の南北軸座標 正の方向を北 L = int(input()) # 1命令につき前進することができる最大の距離 execCount = 0 execCount += math.ceil(abs(X / L)) execCount += math.ceil(abs(Y / L)) # 方向転換 if Y < 0: execCount += 2 # 180度 elif X != 0: execCount += 1 # 90度 print(execCount)