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