X = input() Y = input() L = input() print (abs(X)+L-1)/L+(abs(Y)+L-1)/L + (2 if Y < 0 else (X != 0))