#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <climits>
#include <cmath>
#include <complex>
#include <functional>
#include <cassert>
#include <stack>
#include <numeric>
#include <iomanip>
#include <limits>
#include <random>
#include <unordered_map>

typedef int64_t ll;
typedef std::pair<int, int> Pii;
typedef std::pair<ll, ll> Pll;
typedef std::pair<double, double> Pdd;

#define rip(_i, _n, _s) for (int _i = (_s); _i < (int)(_n); _i++)
#define all(_l) _l.begin(), _l.end()
#define rall(_l) _l.rbegin(), _l.rend()
#define MM << " " <<

template<typename _T>
using MaxHeap = std::priority_queue<_T>;
template<typename _T>
using MinHeap = std::priority_queue<_T, std::vector<_T>, std::greater<_T>>;

template<typename _T>
inline bool chmax(_T &_l, const _T _b) {
    if (_l < _b) {
        _l = _b;
        return true;
    }
    return false;
}
template<typename _T>
inline bool chmin(_T &_l, const _T _b) {
    if (_l > _b) {
        _l = _b;
        return true;
    }
    return false;
}

template<typename _T>
void vdeb(const std::vector<_T> &bb) {
    for (unsigned int i = 0;i < bb.size();i++) {
        if (i == bb.size() - 1) std::cout << bb[i];
        else std::cout << bb[i] << ' ';
    }
    std::cout << '\n';
}
template<typename _T>
void vdeb(const std::vector<std::vector<_T>> &bb) {
    for (unsigned int i = 0;i < bb.size();i++) {
        std::cout << i << ' ';
        vdeb(bb[i]);
    }
    std::cout << '\n';
}

using namespace std;

int main() {
    int a, b; cin >> a >> b;
    a += b;
    if(a >= 15 && b >= 8) cout << 1 << endl;
    else if(a >= 10 && b >= 3) cout << 2 << endl;
    else if(a >= 3) cout << 3 << endl;
    else cout << 4 << endl;
}
#include <iostream>
#include <cstring>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <utility>
#include <set>
const long long INF = 1LL<<60;
using ll = long long;
using namespace std;

int main() {
    ll t,N;cin>>t>>N;
    vector<ll> T(100);
    map<ll,ll> m; 
    ll msize = 0;
    for (int i = 0; i < 100; i++)
    {
        T[i] = (i*t)%100;
        // cout << T[i];
        if(i>0&&T[i]<T[i-1]){
            m[msize] = i-1;
            // cout << " "  <<msize << " " <<i-1;
            msize++;
        }
        // cout << endl;
    }
    m[msize] = 99;
    msize++;
    m[-1] = -1;
    // cout << msize << endl;
    ll id = N%msize;
    ll id1 = (N-id)/msize;
    // cout << id << id1 << endl;
    ll A = id1*100 + m[id-1];
    // cout << A << endl; 
    double b = A*(100+t)/100;
    cout << (ll)(floor(b)+0.5)+1<<endl;
}