#include using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef long double ld; typedef pair P; int main() { ll n; cin >> n; ll res = n; for (ll x = 1; x * x <= n; x++) { if (n % x == 0) { if (x > 2 && x % 2 != 0) res = min(res, x); if (x != n / x) { if ((n / x > 2 ) && (n / x) % 2 != 0) res = min(res, n / x); } } } cout << res << endl; return 0; }