#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>

#define PROB "G"

using namespace std;

int main() {
  freopen(PROB".in", "r", stdin);
  freopen(PROB".out", "w", stdout);
  int n,m;
  cin >> n >> m;
  if(n==m) cout << 4; else cout << 2;
  return 0;
}
