import java.util.*; public class test { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); float lng = (float)Math.sqrt(x*x + y*y); if(lng > (int)lng){ int c = (int)Math.ceil(lng) * 2; System.out.println(c); } else{ int c = (int)lng*2 + 1; System.out.println(c); } } }