#include<bits/stdc++.h>
using namespace std;

int main()
{
  int n,k;
  cin>>n>>k;
  int sum=0;
  int a[n+1][k+1];
  for(int i=1;i<=n;i++){
    for(int j=1;j<=k;j++){
        sum+=(i*100)+j;
    }
  }
  cout<<sum;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <queue>

using namespace std;

int main(){
    int x, y;
    cin >> x >> y;
    if (x == y) cout << x << endl;
    else {
        cout << 3-x-y << endl;
    }
    return 0;
}