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