// 提出時にassertはオフ
#ifndef DEBUG
#ifndef NDEBUG
#define NDEBUG
#endif
#endif

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

#define ALL(x) (x).begin(), (x).end()
template <class T> using vec = vector<T>;

int N;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> N;
    if((N & (- N)) == N){
        cout << 1 << "\n";
    } else if(N % 2 == 0) {
        cout << 3 << "\n";
    } else {
        cout << 2 << "\n";
    }
}