#include using namespace std; using ll=long long; constexpr int MOD=998244353; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rep2(i,l,r) for(int i=(l);i<(int)(r);i++) #define all(v) v.begin(),v.end() constexpr int MAX_D=200000; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); ll X; cin>>X; vector d(0,0ll); rep2(i,3,MAX_D){ while(X%i==0){ d.push_back(i); X/=i; } } if(X!=1)d.push_back(X); if(d.empty())d.push_back(1); ll s=accumulate(all(d),0ll); if(s+d.size()>MAX_D){ cout<<"-1\n"; return 0; } cout<