#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define MAX_MOD 1000000007 #define REP(i,n) for(int i = 0;i < n;++i) int main(){ long long n; cin >> n; long long T_max = n - 1; long long hoge = sqrt(n); long long wow = 1000000000000; for (long long i = hoge+10;i >= 1;--i) { if (n%i == 0) { long long pre_ans = i; int extu = n / i; for (int q = 1;q <= sqrt(extu) + 1;++q) { if (extu % q == 0) { wow = min(wow, pre_ans + q + extu / q); } } } } cout << wow-3 << " " << T_max << endl; return 0; }