#include<cstdio>
#include<cctype>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<climits>
#include<cassert>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<vector>
#include<string>
#include<bitset>
#include<list>
#include<deque>
#include<stack>
#include<queue>
#include<set>
#include<map>

#define inf 1<<30
#define pi acos(-1.0)
#define in(a) scanf("%lld",&a)
#define FOR(a,b,c) for(a=b;a<=c;a++)
#define ROF(a,b,c) for(a=c;a>=1;a--)
#define For(a,b,c) for(a=b;a<c;a++)
#define roF(a,b,c) for(a=c-1;a>=0;a--)
#define rep(i,a,b,c) for(i=a;i<=b;i+=c)
#define mm(arr,x) memset(arr,x,sizeof(arr))
#define pf printf
#define fin freopen("in.txt","r",stdin)
#define fout freopen("out.txt","w",stdout)
#define pb push_back
#define sq(x) ((x)*(x))
#define Sqrt(n) (long long)round(sqrt((double)n))
#define logg(x,y) (double)log(y)/(double)log(x)
#define cl clear()
#define ps push
#define mod 1000000007
#define mid (lo+hi)/2
#define LEFT node*2
#define RIGHT (node*2)+1


using namespace std;
typedef long long ll;
typedef string S;
typedef double D;

vector<char>v_char_small,v_char_cap;

void char_vector()
{
    for(ll i=0;i<26;i++)
        v_char_small.pb('a'+i);
    for(ll i=0;i<26;i++)
        v_char_cap.pb('A'+i);
}

vector<S>v_str_2;

void str_vector_2()
{
    v_str_2.pb("Aa");
    v_str_2.pb("Ab");
    v_str_2.pb("Ac");
    v_str_2.pb("Ad");
    v_str_2.pb("Ae");
    v_str_2.pb("Af");
    v_str_2.pb("Ag");
    v_str_2.pb("Ah");
    v_str_2.pb("Ai");
    v_str_2.pb("Aj");
    v_str_2.pb("Ak");
    v_str_2.pb("Al");
    v_str_2.pb("Am");
    v_str_2.pb("An");
    v_str_2.pb("Ao");
    v_str_2.pb("Ap");
    v_str_2.pb("Aq");
    v_str_2.pb("Ar");
    v_str_2.pb("As");
    v_str_2.pb("At");
    v_str_2.pb("Au");
    v_str_2.pb("Av");
    v_str_2.pb("Aw");
    v_str_2.pb("Ax");
    v_str_2.pb("Ay");
    v_str_2.pb("Az");

    v_str_2.pb("Ba");
    v_str_2.pb("Bb");
    v_str_2.pb("Bc");
    v_str_2.pb("Bd");
    v_str_2.pb("Be");
    v_str_2.pb("Bf");
    v_str_2.pb("Bg");
    v_str_2.pb("Bh");
    v_str_2.pb("Bi");
    v_str_2.pb("Bj");
    v_str_2.pb("Bk");
    v_str_2.pb("Bl");
    v_str_2.pb("Bm");
    v_str_2.pb("Bn");
    v_str_2.pb("Bo");
    v_str_2.pb("Bp");
    v_str_2.pb("Bq");
    v_str_2.pb("Br");
    v_str_2.pb("Bs");
    v_str_2.pb("Bt");
    v_str_2.pb("Bu");
    v_str_2.pb("Bv");
    v_str_2.pb("Bw");
    v_str_2.pb("Bx");
    v_str_2.pb("By");
    v_str_2.pb("Bz");

    cout<<v_str_2.size()<<endl;

}

ll max_even(ll x)
{
    if(x%2==0)
        return x;
    return x-1;
}

ll min_odd(ll x)
{
    if(x%2==0)
        return x-1;
    return x;
}

string itoaa(ll n)
{
    char x[100]={'\0'};
    ll lim=log10(n);
    for(ll i=lim;i>=0;i--)
    {
        x[i]=(n%10)+'0';
        n=n/10;
    }
    string r=x;
    return r;
}

ll gcd(ll a,ll b)
{
    while(1)
    {
        if(b%a==0)
            return a;
        if(a==1)
            return 1;
        ll x=a;
        a=b%a;
        b=x;
    }
    return 1;
}

ll min(ll a,ll b,ll c)
{
    return min(min(a,b),c);
}

ll min(ll a,ll b,ll c,ll d)
{
    return min(min(a,b,c),d);
}

ll min(ll a,ll b,ll c,ll d,ll e)
{
    return min(min(a,b,c,d),e);
}

ll min(ll a,ll b,ll c,ll d,ll e,ll f)
{
    return min(min(a,b,c,d,e),f);
}

ll max(ll a,ll b,ll c)
{
    return max(max(a,b),c);
}

ll max(ll a,ll b,ll c,ll d)
{
    return max(max(a,b,c),d);
}

ll max(ll a,ll b,ll c,ll d,ll e)
{
    return max(max(a,b,c,d),e);
}

ll max(ll a,ll b,ll c,ll d,ll e,ll f)
{
    return max(max(a,b,c,d,e),f);
}

ll poww(ll x,ll n)
{
    ll sum=1,i;
    for(i=1;i<=n;i++)
        sum*=x;
    return sum;
}

ll upr_bnd(ll x,ll siz,ll *arr)
{
    return upper_bound(arr,arr+siz,x)-arr;
}

ll lr_bnd(ll x,ll siz,ll *arr)
{
    return lower_bound(arr,arr+siz,x)-arr;
}

ll int_point_distance(ll x1,ll y1,ll x2,ll y2)
{
    return sqrt(((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)));
}

float float_point_distance(float x1,float y1,float x2,float y2)
{
    return sqrt(((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)));
}

void arrin(ll *arr,ll lo,ll hi)
{
    ll i;
    for(i=lo;i<=hi;i++)
        in(arr[i]);
}

void fourth_pos(ll a1,ll b1,ll a2,ll b2,ll a3,ll b3)
{
    //pf("%lld %lld %lld %lld %lld %lld\n",a1,b1,a2,b2,a3,b3);
    ll x=a1-(a3-a2);
    ll y=b1-(b3-b2);
    pf("%lld %lld\n",x,y);
    return;
}

void siv(ll n)
{
    ll arr[n],i,j,sq;
    vector<ll>prime;
    mm(arr,0);
    for(i=2;i<=n;i+=2)
        arr[i]=1;
    sq=sqrt(n);
    for(i=3;i<=sq;i+=2)
    {
        if(arr[i]==0)
        {
            for(j=i*2;j<=n;j+=i)
                arr[j]=1;
        }
    }
    ll cnt=0;
    prime.pb(2);
    for(i=2;i<=n;i++)
        if(arr[i]==0)
            prime.push_back(i);
    pf("%lld\n",(ll)prime.size());
    return;
}



                                                                ///.............................bfs_1D(a,b)

/*ll bfs_1D(ll a,ll b)
{
    ll vis[10000],parent[10000],x,y,sz;
    mm(vis,-1);
    queue<ll>q;
    q.push(a);
    vis[a]=0;
    while(q.size()>0)
    {
        x=q.front();
        q.pop();
        sz=v[x].size();
        for(i=0;i<sz;i++)
        {
            y=v[x][i];
            if(vis[y]==-1)
            {
                q.push(y);
                vis[y]=vis[x]+1;
                if(y==b)
                    return vis[y];
            }
        }
    }
    return -1;
}*/

                                                             ///.............................bfs_2D

/*ll bfs_1D(ll a1,ll b1,ll a2,ll b2,ll max_n,ll max_m)
{
    ll vis[max_n][max_m];
    ll direction_1[8]={0,1,0,-1,1,0,-1,0};
    ll direction_2[16]={0,1,0,-1,1,0,-1,0,1,1,1,-1,-1,1,-1,-1};
    struct ss
    {
        ll x,y;
        ss(ll a,ll b)
        {
            x=a;
            y=b;
        }
    };

    mm(vis,-1);
    queue<ss>q;

    q.push(ss(a1,b1));
    vis[a1][b1]=0;
    while(!q.empty())
    {
        ll x=q.front().x;
        ll y=q.front().y;

        for(i=0;i<16;i+=2)
        {
            ll xx=x+direction_2[i];
            ll yy=y+direction_2[i+1];

            if(xx>=0 && xx<n && y>=0 && yy<m && vis[xx][yy]==-1)
            {
                vis[xx][yy]=vis[x][y]+1;
                q.push(ss(xx,yy));
                if(xx==a2 && yy==b2)
                    return vis[xx][yy];
            }
        }
    }
    return -1;
}*/

                                                        ///............................. dijkstra_1D()
/*struct ss
{
    ll b,c;
    ss(ll y,ll z)
    {
        b=y,c=z;
    }
};

struct comp {
    bool operator() (const ss l,ss r) {
        return l.c<r.c;
    }
};

bool operator<(ss l, ss r) {return l.c < r.c ? true : false;}

vector<ss>v[501];
ll vis[501];

ll dijkstra_1D(ll a,ll b,ll n)
{
    for(ll i=0;i<=n;i++)
        vis[i]=(1<<20);
    queue<ss>q;
    q.push(ss(a,0));
    vis[a]=0;

    //pf("a = %lld\n",a);
    while(q.size()>0)
    {
        a=q.front().b;
        ll c=q.front().c;
        //pf("A = %lld C = %lld\n",a,c);
        q.pop();
        ll sz=v[a].size();
        //pf("Siz = %lld..........\n",sz);
        for(ll i=0;i<sz;i++)
        {
            ll x,y;
            x=v[a][i].b;
            y=v[a][i].c;
            //system("pause");
            //pf("X = %lld\n",x);
            //pf("Now vis[x] = %lld and c+y = %lld\n",vis[x],c+y);
            if(vis[x]>c+y)
            {
                vis[x]=c+y;
                q.push(ss(x,vis[x]));
            }
        }
        //pf("%lld size\n",q.size());
    }
    return vis[b];
}*/


                                                              ///************************* trie

/*struct ss
{
    struct ss *next[26];
    bool yes_no;
    ll cnt;
    ss()
    {
        ll i=0;
        yes_no=false;
        cnt=-1;
        for(i=0;i<26;i++)
            next[i]=NULL;
    }
}*root;


ll trie(string s,ll len)
{
    ll i,j,k,l;

    ss *curr=root;

    for(ll i=0;i<len;i++)
    {
        if(curr->next[s[i]-'a']==NULL)
            curr->next[s[i]-'a']=new ss();
        curr=curr->next[s[i]-'a'];
    }
    curr->cnt+=1;
    curr->yes_no=true;
    return curr->cnt;
}


*/


                                            ///****************************************    Tree Diametre

/*

ll tree_diametre(ll x)
{
    mm(vis,-1);
    mm(parent,-1);
    queue<ll>q;
    vis[x]=0;
    q.push(x);
    ll mxx=0;
    ll pos=-1;
    while(!q.empty())
    {
        x=q.front();
        q.pop();
        ll sz=v[x].size();
        for(ll i=0;i<sz;i++)
        {
            ll y=v[x][i];
            if(vis[y]==-1)
            {
                vis[y]=vis[x]+1;
                parent[y]=x;
                q.push(y);
                if(vis[y]>mxx)
                {
                    mxx=vis[y];
                    pos=y;
                }
            }
        }
    }
    return pos;
}

*/




///**************************************************************************************** Top Sort (DAG)
/*

struct ss
{
    ll node,degree;
    ss(ll a,ll b)
    {
        node=a;
        degree=b;
    }
};

bool operator<(const ss& l, const ss& r)
{
  return r.degree < l.degree;
}

priority_queue<ss>q;

ll solve()
{
    ll cnt=0,maxx=q.size();

    vis2[q.top().node]=1;
    cnt++;
    if(q.top().degree>0)
        return 0;
    else
    {
        while(!q.empty()&& cnt++<=maxx)
        {
            ll x=q.top().node;
            ll dgr=q.top().degree;
            q.pop();
            if(dgr>0)
                return 0;
            ll sz=v2[x].size();
            vis2[x]=1;
            v.pb(x);
            for(ll i=0;i<sz;i++)
            {
                ll y=v2[x][i];
                if(vis2[y]!=-1)
                    continue;
                indegree[y]--;
                if(vis1[y]!=-1)
                q.push(ss(y,indegree[y]));
            }
        }
    }
    return 1;
}
*/


///............................................................................ Topsort  (DFS)
/*

vector<ll>v[10005];
ll timer;

void dfs(ll root)
{
    vis[root].st=++timer;
    vis[root].pos=root;
    ll sz,i,j,x;
    sz=v[root].size();
    for(i=0;i<sz;i++)
    {
        x=v[root][i];
        if(vis[x].st==-1)
            dfs(x);
    }
    vis[root].ed=++timer;
}

bool compare(ss l,ss r)
{
    if(l.ed==r.ed)
        return l.pos>r.pos;
    return l.ed>r.ed;
}

*/

                                                                ///   Topsort  (DAG)
/*
vector<ll>v[100005],VV;
struct ss
{
    ll node;
    ll dgr;
    ss(ll a,ll b)
    {
        node=a;
        dgr=b;
    }
};

bool operator<(const ss& l, const ss& r) {
  return l.dgr > r.dgr;
}

priority_queue<ss>q;

ll indegree[100005],vis[100005];


ll DAG(ll n)
{
    for(ll i=1;i<=n;i++)
        q.push(ss(i,indegree[i]));

    mm(vis,-1);

    if(q.top().dgr!=0)
        return -1;

    while(!q.empty())
    {
        ll a=q.top().node;
        ll r=q.top().dgr;
        q.pop();
        ll sz=v[a].size();
        if(vis[a]==-1)
            pf("%lld ",a);
        else
            continue;
        vis[a]=1;
        for(ll i=0;i<sz;i++)
        {
            ll x=v[a][i];
            if(indegree[x]>=1)
                q.push(ss(x,--indegree[x]));
        }
    }
    return 1;
}


*/


struct ss
{
    ll a;
    ll cost;
    ss(ll x,ll y)
    {
        a=x;
        cost=y;
    }
};

vector<ss>v;

/*bool operator<(const ss& l, const ss& r) {
  return r.cost < l.cost;
}*/

int main()
{
    ll i,j,k,n,m,x,cnt=0,count=0,t,y,p,q,maxx=0,minn=1<<30,a,b,test=0,len,sum=0,c;
    string s,s1,s2;
    in(n),in(m);
    n--; m--;
    pf("%lld\n",n*m);
}



Measured memory_bytes: 256