#include using namespace std; typedef long long loong; int main() { loong n,t; cin >> n; t=n; for(loong i=1;i*i*i<=n;++i){ if(n%i==0){ loong m=n/i; for(loong j=1;j*j<=m;++j){ if(m%j==0){ loong k=m/j; if(t>i+j+k-3){ t=i+j+k-3; } } } } } cout << t << " " << n-1 << endl; return 0; }