local n = io.read("*n") for i = 1, n do if n <= math.floor(i * (i + 1) / 2) then print(i) break end end