import math def main(): Xp,Yp = map(int,input().split()) Z = (Xp**2+Yp**2)**0.5 print(math.floor(2*Z+1)) if __name__ =='__main__': main()