N = gets.to_i ok = N ng = 0 while (ok - ng).abs >= 2 k = (ok + ng) / 2 if N <= Rational(k * (k + 1), 2) ok = k else ng = k end end puts ok