#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define rev_rep(i, a, b) for (int i = a; i >= b; i--)
#define vi vector<int>
#define pb push_back
#define pi pair<int, int>
#define mod = 1e9 + 7

void __print(int x)
{
    cerr << x;
}
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x)
{
    cerr << '{';
    __print(x.first);
    cerr << ',';
    __print(x.second);
    cerr << '}';
}
template <typename T>
void __print(const T &x)
{
    int f = 0;
    cerr << '{';
    for (auto &i : x)
        cerr << (f++ ? "," : ""), __print(i);
    cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v)
{
    __print(t);
    if (sizeof...(v))
        cerr << ", ";
    _print(v...);
}
#ifndef ONLINE_JUDGE
#define debug(x...)               \
    cerr << "[" << #x << "] = ["; \
    _print(x)
#else
#define debug(x...)
#endif

/* ************************************ CODE STATRTS HERE  *************************************/



void solve()
{
 int n , k ;
 cin>>n>>k;
 int sum = 0;
 rep(i,1,n)
 {
     rep(j,1,k) 
     sum += i*100 + j;
 }
 cout<<sum<<endl;
    
   
    

}
int main()
{
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
#include <bits/stdc++.h>
using namespace std; 
#define pb push_back
#define S second
#define F first
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vll vector<long long int>
#define vld vector<long double>
#define pll pair<long long int,long long int>
#define mod 1000000007
#define mod2 998244353
#define ll long long int
#define ld long double
#define pi 3.141592653589793238
#define Endl endl
#define endl "\n"
const int N = 1e6 + 5;
const ll inf = 1e18;
// unordered_map<ll,ll> rk;
// bool cmp(ll a,ll b)
// {
//         return rk[a] < rk[b];
// }


void solve() 
{
        ll a,b;
        cin>>a>>b;
        a=a+b;
        if(a>=15 && b>=8)
                cout<<"1";
        else if(a>=10 && b>=3)
                cout<<"2";
        else if(a>=3)
                cout<<"3";
        else
                cout<<"4";
}


void debug(ll tt) {}
 // [L,R] make a window which matches with prefix of s 
signed main()
{
        FAST;
        int t = 1;
        //cin >> t;
        //fill();
        while(t--)
        {
                solve();
        }
}
