#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pci pair <char, int>
#define pld pair <ld, ld>
#define ppld pair <pld, pld>
#define ppll pair <pll, pll>
#define pldl pair <ld, ll>
#define vll vector <ll>
#define vvll vector <vll>
#define vpll vector <pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define fastmap gp_hash_table
#define cd complex <double>
#define vcd vector <cd>
#define PI 3.14159265358979
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	ll x, y; cin >> x >> y;
	if (x == y) cout << x << "\n";
	else cout << 3 - x - y << "\n";
}
#include <iostream>

using namespace std;

int a, b, ans;

int main() {
  cin >> a >> b;
  for (int i = 1; i <= 2e5; i++) {
    if (b / i - (a - 1) / i > 1) {
      ans = i;
    }
  }
  cout << ans;
  return 0;
}