#include "bits/stdc++.h" #define _CRT_SECURE_NO_WARNINGS #define rep(i,n) for(int i = 0;i < n;i++) #define REP(i,n,k) for(int i = n;i < k;i++) #define P(p) cout << (p) << endl; #define sP(p) cout << setprecision(15) << fixed << p << endl; #define Pi pair #define IINF 1e9 #define LINF 1e18 #define vi vector using namespace std; typedef long long ll; typedef unsigned long long ull; int dx[] = { 1, 0,-1,0 }; int dy[] = { 0, 1,0,-1 }; void solve() { ll n; cin >> n; ll half; for (ll i = 1; i*i <= n; i++) { if (n % i == 0)half = i; } ll left = n / half; ll a, b, c, d; for (ll i = 1; i*i <= half; i++) { if (half % i == 0)a = i; } b = half / a; for (ll i = 1; i*i <= left; i++) { if (left % i == 0)c = i; } d = left / c; cout << a + b + c + d - 4<< " " << n - 1 << endl; } int main() { solve(); return 0; }