n = int(input()) high = 2*10**18 low = 0 flag = 0 while high-low>1: mid = (high+low)//2 k = (mid*(mid+1))//2 if k>n: high = mid elif k