#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; #define all(c) (c).begin(), (c).end() #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define pb(e) push_back(e) #define mp(a, b) make_pair(a, b) #define fr first #define sc second const ll INF = 1e9; const ll MOD = 1e9 + 7; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; vector f(ll N) { vector vs; for (ll i = 2; i * i <= N; i++) { while (N % i == 0) { vs.push_back(i); N /= i; } } if (N != 1) vs.push_back(N); return vs; } int main() { ll N; cin >> N; auto vs = f(N); ll t[3] = {1, 1, 1}; ll ans = 0; while(vs.size()) { auto it = vs.begin(); rep(i, 3) { if(it==vs.end()) break; t[i]*=*it; it=vs.erase(it); } reverse(all(vs)); } rep(i, 3) ans += t[i] - 1; cout << ans << " " << N - 1 << endl; return 0; }