#include #define ll long long using namespace std; int main(void) { ll N; cin >> N; int ans = 0; for(int i = 3; !ans; i++) { if(!(N%i)) ans = i; } cout << ans << endl; return 0; }