#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n,m; long long s; scanf("%d%d",&n,&m); if(n==1||m==1) s=n+m-2; else { s=n; s=s*(m-1); s--; s=s+n; } printf("%lld",s); return 0; }