import sys input = sys.stdin.readline N=int(input()) OK=1 NG=10**9 while NG-OK>1: mid=(OK+NG)//2 if mid*(mid+1)//2<=N: OK=mid else: NG=mid print(OK)