#include int main(void){ int x,y,p,t,min = 0,max = 30000; scanf("%d%d",&x,&y); while(1){ p = (min+max)/2; t = x*x*4+y*y*4; if(t >= p*p && (p+1)*(p+1) > t){p++;break;} if(t >= p*p){min = p;continue;} if(t < (p+1)*(p+1)){max = p;continue;} p++; } printf("%d\n",p); return 0; }