num = STDIN.readlines.map(&:chomp) X = num[0].to_i Y = num[1].to_i L = num[2].to_i x = X.abs y = Y.abs count = 0 if Y > 0 y_ans = Y.divmod(L) count += y_ans[0] if y_ans[1] > 0 count += 1 end count += 1 unless x == 0 x_ans = x.divmod(L) count += x_ans[0] if x_ans[1] > 0 count += 1 end puts count else count += 1 x_ans = x.divmod(L) count += x_ans[0] if x_ans[1] > 0 count += 1 end count += 1 unless y == 0 y_ans = y.divmod(L) count += y_ans[0] if y_ans[1] > 0 count += 1 end puts count end