#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

#define f(n) for(int i = 0; i < n; i++)

int main () {
    int n, r, b;
    bool nprime[n+1];
    cin >> n;

    f(n+1) {
        for (int k = 2; k < n; k++) {
            if (i % k == 0) {
                nprime[i] = true;
            }
        }
    }

    if (nprime[n+1] == false) {
        cout << "1";
        return 0;
    }

    for (int h = 1, h < n+2; h++) {
        if(nprime[h] == false) {
            b++;
        }
    }

    int primen[b];
    int g = 0;

    for (int h = 1, h < n+2; h++) {
        if(nprime[h] == false) {
            primen[g] = h;
            g++;
        }
    }

    if (b==2) {
        cout << "2";
        return 0;
    }

    //2x1
    r++;

    //1x1


    //0x1


    return 0;
}



