while 1:a,b=map(int,raw_input().split());print"%.f"%(((a*a*4+b*b*3)**.5-a)/3)