#include #include using namespace std; typedef long long ll; int main(){ ll n; cin>>n; ll T=n-1; ll t=1e11; //(横に切った回数+1)x(縦に切った回数+1)*(高さに切った回数+1) ll yoko=0,tate=0,takasa=0; for(yoko=0;yoko<=n;yoko++){ for(tate=0;tate<=n;tate++){ for(takasa=0;takasa<=n-(tate*yoko);takasa++){ if((yoko+1)*(tate+1)*(takasa+1)==n){ t=min(yoko+tate+takasa,t); //T=max(yoko+tate+takasa,T); } } } } cout<