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

typedef long long ll;

int main()
{
    ll n, k;
    cin >> n >> k;
    ll sum = 0;
    for (ll i = 1; i <= n; i++)
    {
        for (ll j = 1; j <= k; j++)
        {
            sum += i * 100 + j;
        }
    }
    cout << sum;
}
#include <bits/stdc++.h>
//#include <chrono>
#pragma GCC optimize("O3")
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()

using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;

ll N,M,H,W,Q,K,A,B;
string S;
using P = pair<ll, ll>;
const ll INF = (1LL<<60);

template<class T> bool chmin(T &a, const T b){
    if(a > b) {a = b; return true;}
    else return false;
}
template<class T> bool chmax(T &a, const T b){
    if(a < b) {a = b; return true;}
    else return false;
}
template<class T> void my_printv(std::vector<T> v,bool endline = true){
    if(!v.empty()){
        for(std::size_t i{}; i<v.size()-1; ++i) std::cout<<v[i]<<" ";
        std::cout<<v.back();
    }
    if(endline) std::cout<<std::endl;
}

vec prime;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin>>A>>B;
    N = B - A + 1;
    reps(i, 2, 72){
        bool pr = true;
        reps(j, 2, i) if(i%j == 0) pr = false;
        if(pr) prime.push_back(i);
    }

    vector<int> pelem(N, 0);
    rep(i, 20){
        ll p = prime[i];
        rep(j, N){
            pelem[j] |= (((A + j)%p == 0) ? 1 : 0)<<i;
        }
    }

    vec dp(1<<20, 0), ndp(1<<20, 0);
    dp[0] = 1;
    rep(i, N){
        int a_s = pelem[i];
        //cout<<bitset<20>(a_s)<<endl;
        rep(s, 1<<20){
            if((s&a_s) == 0){
                ndp[s | a_s] += dp[s];
            }
        }
        rep(s, 1<<20) {
            dp[s] += ndp[s];
            ndp[s] = 0;
        }
    }
    cout<<accumulate(ALL(dp), 0)<<endl;
}