#include <bits/stdc++.h>

using namespace std;

int main() {
    int a, b;
    cin >> a >> b;

    vector<int> x(200001, 0);
    for (int i = 1; i <= b; ++i) {
        x[i] = b / i - (a - 1) / i;
    }
    
    int ret = 1;
    for (int i = 1; i < 200001; ++i) {
        if (x[i] >= 2) {
            if (ret < i) ret = i;
        }
    }
    cout << ret << endl;
    
    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <array>
#include <queue>
#include <cstring>
#include <unordered_map>
#include <set>
#include <climits>
#include <cmath>
using namespace std;
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define MOD 1000000007
#define MAX 100005
using ll = long long int; 
#define all(x) (x).begin(), (x).end()

const int N = 1e3 + 1;





int main()
{
	speed;
	ll a, b;
	cin >> a >> b;
	ll total = 2 * a + 100;
	cout << total - b << '\n';


	
	return 0;
}