#include #include #include #include #include #include #include #include #include #include #include #include #include #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() using namespace std; typedef long long ll; typedef pair pi; typedef pair pl; typedef pair pls; int main() { ll N,mx,mi=0,num; cin >> N; mx = N - 1; if (N % 2 != 0)mi = N - 1; else { mi = 1e11; for (int i = 1; i < 10000; i++) { for (int j = 1; j < 10000; j++) { if (N % (i*j) == 0) { mi = min(i - 1 + j - 1+(N/(i*j))-1,mi); } } } } cout << mi << " " << mx << endl; return 0; }