#include #include int main(){ int a,b; scanf("%d%d",&a,&b); printf("%d",a=sqrt(a*a+b*b)*2+1); return 0; }