#!/usr/bin/env python3 #fileencoding: utf-8 from math import sqrt, ceil x,y = [int(i) for i in input().strip().split(" ")] r = sqrt(x**2 + y**2) R = ceil(r)*2 if R > r*2: print(R) else: print(R+1)