#include #include using namespace std; using namespace atcoder; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll inf=155550555555555; ll mod=1000000007; int main(){ ll n; cin >> n; vectortwo(50,1); for (ll i = 1; i < 50; i++) { two[i]=two[i-1]*2; } bool ok=false; for (ll i = 0; i < 50; i++) { if (two[i]==n) { ok=true; break; } } if (ok) { cout << 1 << endl; }else if (n%2) { cout << 2 << endl; }else{ cout << 3 << endl; } }