#include <bits/stdc++.h>
using namespace std;
// TYPEDEF ------------------------------
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pair;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<vector<ll>> Graph;
typedef vector<string> vs;
typedef vector<pair<ll, ll>> Pll;
typedef queue<ll> qll;
typedef map<ll, ll> mll;
// REPEAT ------------------------------
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
// UTIL ------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end() // 注意；https://kimiyuki.net/blog/2015/09/25/competitive-programming-coding/
#define SORT(a) sort((a).begin(),(a).end())
#define RSORT(a) sort((a).rbegin(), (a).rend())
#define REVERSE(x) reverse(ALL(x))
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define SUM(x) accumulate(ALL(x), (ll)0)
#define COUNT(x, y) count(ALL(x), y);
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
// PRINT ------------------------------
#define COUT(a) cout << (a) << endl;
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
// DEBUG ------------------------------
#define LINE cerr << "[debug] line: " << __LINE__ << "\n";
#define debug(...) {debug_all(#__VA_ARGS__, __VA_ARGS__);}
template < typename T >
void _debug_print(T const& a) {cerr << a << ", ";}
template < typename... Args >
void debug_all(string s, Args... args) {
  cerr << "[debug] " << s << " = ";
  using swallow = std::initializer_list<int>;
  (void)swallow{ (void( _debug_print(args) ), 0)... };
  cerr << endl;
}
#define debugV(v) cerr << "[debugV] " << #v << ":"; REP(z, v.size()) cerr << " " << v[z]; cerr << "\n";
// CONST ------------------------------
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279; // or M_PI

//######################################################################
//#                         ここから下に書いていく                         #
//######################################################################

void Main() {
  ll n, k;
  cin >> n >> k;

  ll ans = 0;
  REP(i, n) {
    REP(j, k) {
      ans += (i+1) * 100;
      ans += (j+1);
    }
  }    
  COUT(ans);
}

int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
}


/*

3 2
*/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
ll gcd(ll x, ll y) {return (x%y) ? gcd(y, x%y) : y; }
const int inf = 1000000000;
const int dx[]={1,0,-1,0};
const int dy[]={0,1,0,-1};
const ll mod = 1e9+7;

int main(){
    string a, b;
    cin >> a >> b;
    int suma = 0;
    int sumb = 0;
    rep(i,3){
        suma += (a.at(i)-'0');
    }
    rep(i,3){
        sumb += (b.at(i)-'0');
    }
    cout << max(suma, sumb) << endl;
}