from decimal import Decimal, getcontext getcontext().prec = 40 x, y = map(Decimal, input().split()) r = (2*(x*x + y*y).sqrt()+1).to_integral('ROUND_FLOOR') print(r)