#include <bits/stdc++.h>
using namespace std;
long double PI = 3.1415926535897932;
const int N = 2e6 + 1000;
long long int ans, ans1, sum, cnt, a[N], b[N];
long long int n, p, m, k;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cout << setprecision(12) << fixed;
  cin >> n >> m;
  if (n == m) {
    cout << n;
    return 0;
  }
  cout << 2;
  return 0;
}
