import java.util.*;class Main{public static void main(String[] args){Scanner ir=new Scanner(System.in);System.out.println((int)Math.floor(2*Math.hypot((double)ir.nextInt(),(double)ir.nextInt()))+1);}}