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