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