while 1:int(not (int(input())*8+1)**.5%1)