#include <iostream>
#include <algorithm>
using namespace std;

int primer[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 };
int cnt[10];

int main() {
    int n;
    cin >> n;
    for (int i = 2; i <= n; ++i) {
        int x = i;
        for (int j = 0; j < 10; ++j) {
            int c = 0;
            while (x % primer[j] == 0) {
                x /= primer[j];
                ++c;
            }
            cnt[j] = max(cnt[j], c);
        }
    }
    unsigned long long res = 1;
    for (int i = 0; i < 10; ++i) {
        for (int j = 0; j < cnt[i]; ++j) {
            res *= primer[i];
        }
    }
    cout << res + 1 << endl;
    return 0;
}

#include<stdio.h>
#include<math.h>
#include<string.h>
 
#define ni(n) ((n) * (n))
#define rep(i,n) for(i=0;i<n;i++)
#define N 100050

int main(void){
	int a;
	int i;
	int sum = 0;
	rep(i,2){
		scanf("%d",&a);
		sum += a;
	}
	if(sum == 0) printf("0");
	else if(sum == 4) printf("2");
	else printf("%d",3-sum);
	return 0;
}