#include<iostream> using namespace std; int main(){ int n; cin>>n; int i=n/2; while(n%i){ i--; } cout<<i<<endl; return 0; }