#include #include #include #include #include #include #include #include #include #include #include #include #include #define p(s) cout<<(s)<=n;i--) #define CK(n,a,b) ((a)<=(n)&&(n)<(b)) #define F first #define S second typedef long long ll; using namespace std; ll N,ans; int main(){ cin>>N; if(N%2) ans=N; else ans=N/2; for(ll i=3;i*i<=N;i++){ if(N%i==0){ ans=i; break; } } p(ans); return 0; }