证明篇幅太长就不弄过来了
#include<cstdio>
int main(){
int n,m,ans;
freopen("t.in","r",stdin);
freopen("t.out","w",stdout);
scanf("%d%d",&n,&m);
if (n==1) ans=m-m/2;
else if (m==1) ans=n-n/2;
else if (n%3==0 || m%3==0) ans=2;
else ans=1;
printf("%d\n",ans);
return 0;
}