#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>
#include<set>
#include<cstdio>
#include<map>
#include<cassert>

using namespace std;

#define ll long long
#define reps(i, a, b) for(int i = a; i < b; i++)
#define rreps(i, a, b) for(int i = a-1; i >= b; i--)
#define rep(i, n) reps(i, 0, n)
#define rrep(i, n) rreps(i, n, 0)
#define P pair<int, int>
#define vec vector<int>
#define mat vector<vec>

const ll mod = 1000000007;
const int INF = 1001001001;

int main(){
    int a, b;
    cin >> a >> b;
    int c = a + b;
    int ans;
    if(c >= 15 && b >= 8){
        ans = 1;
    }else if(c >= 10 && b >= 3){
        ans = 2;
    }else if(c >= 3){
        ans = 3;
    }else{
        ans = 4;
    }
    cout << ans << endl;
}
#include <bits/stdc++.h>
using namespace std;
#define int long long

const int mod = 1e9 + 7;
const int N = 1e6 + 5;

int g[N];

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	

	int l, r;
	cin >> l >> r;
	for (int i = 2; i <= r; i++) {
		int x = ceil(1.0 * l / i), y = floor(1.0 * r / i);
		g[i] = (y - x + 1) * (y - x + 1);
	}

	int ans = 0;
	for (int i = max(l, 2ll); i <= r; i++) 
		ans -= r / i * 2 - 1;


	for (int i = r; i >= 2; i--) {
		for (int j = 2; i * j <= r; j++) {
			g[i] -= g[i * j];
		}
		ans += g[i];
	}

	cout << ans;

}