#include #include int main() { long long int n,m; scanf("%lld %lld", &n, &m); printf("%lld", (m-1) + (m)*(n-1)); return 0; }