Go: package main

import (
    "fmt"
    "math"
)

func main() {
    var e int
    for {
        fmt.Scan(&e)
        if e == 0 { break }

        var ans float64 = float64(e)
        for z := 0; z <= 101; z++ {
            for y := 0; y <= 1001; y++ {
                x := e - y*y - z*z*z
                if (0 <= x && x <= 100000) {
                  ans = math.Min(ans, float64(x+y+z));
                }
            }
        }
        fmt.Println(ans)
    }
}

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <cfloat>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>

using namespace std;

typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef istringstream ISS;
typedef ostringstream OSS;

const int INF = INT_MAX / 4;
const double EPS = 1e-12;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define EACH( v, c ) for ( auto &v : c )

#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

int main()
{
	while ( true )
	{
		int e;
		cin >> e;

		if ( !e )
		{
			break;
		}

		ULL min = INT_MAX;

		for ( ULL x = 0; x <= e; x++ )
		{
			for ( ULL y = 0; y * y <= e; y++ )
			{
				for ( ULL z = 0; z * z * z <= e; z++ )
				{
					if ( x + y * y + z * z * z == e )
					{
						min = std::min( min, x + y + z );
					}
				}
			}
		}

		cout << min << endl;
	}

	return 0;
}

C++: #include <iostream>
#include<math.h>
using namespace std;
int main() {
	 int e;
	cin >> e;

	while (e!=0) {
		int min = e;
		for (int z = 0; z <= 100; z++) {
			for (int y = 0; y <= 1000; y++) {
				int z2 = z * z,y2=y*y;
				int z3 = z2 * z;
				int x = e - y2 - z3;
				if (x < 0)break;
				int a = x + y + z;
				if (a < min)min = a;
			}
		}
		cout << min << endl;
		cin >> e;
	}
}

C++: #include <iostream>

using namespace std;

int main(){
	int e; cin >> e;
	while(e){
		int min = 1 << 21;
		for(int i = 0; i * i * i <= e; i++){
			for(int j = 0; j * j + i * i * i <= e; j++){
				if(e - (i * i * i + j * j) + j + i < min){
					min = e - (i * i * i + j * j) + j + i;
				}
			}
		}
		cout << min << endl;

		cin >> e;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30

using namespace std;
typedef long long ll;

int main()
{
    int n;
    while(cin >> n && n) {
        int ans = INF;
        rep(i,100000) {
            if(i  > n) break;
            rep(j,100000) {
                if(i + j*j > n) break;
                rep(k,100000) {
                    if(i + j*j + k*k*k > n) break;
                    if(i + j*j + k*k*k == n) {
                        ans = min(ans,i+j+k);
                        break;
                    }
                }
            }
        }

        cout << ans << endl;
    }

    return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int e,x,y,z,small ;
	z=0;
	small=10000000;
	while(cin >> e && e>0){
		while(z*z*z < 1000000){
			y = 0 ;
			while(y*y < 1000000){
				x = e-y*y-z*z*z;
				if(small > x+y+z){
				small = x+y+z;
				}
			y = y+1;
			}
		z = z+1;
		}
	cout << small << endl ;
	}
}

C++: #include <iostream>
#include <string>
#include <map>
#include <math.h>
#include <complex>

using namespace std;

int main(){

    int e;

    while(cin>>e,e){

        int x,y,z;
        int answer = 1000000;
        for(int i=0;i<=e;i++){
            for(int j=0;j<=sqrt(e);j++){
                for(int k=0;k<=pow(e,1.0/3.0);k++){
                    if(i+pow(j,2.0)+pow(k,3.0)==e&&answer>i+j+k){
                        answer = i+j+k;
                    }
                }
            }
        }

        cout<<answer<<endl;
    }

    return 0;
}

C++: #include<iostream>
#include<cmath>

using namespace std;

int main() {
    while (1) {
        int e;
        cin >> e;

        if(e == 0) break;

        int m = 10000000;
        int zmax = (int)floor(cbrt(e));
        for (int z = 0; z <= zmax; ++z) {
            int y = (int)floor(sqrt(e - z * z * z));
            int x = e - z * z * z - y * y;
            if (m > x + y + z) m = x + y + z;
        }
        cout << m << endl;
        
    }
}

C++: #include<iostream>

using namespace std;

int main(void){
  int e,min,f;
  cin >> e;
  while(e!=0){
    f=0;
    for(int z=0;z*z*z <= e;z++){
      for(int y=0;y*y <= e-z*z*z;y++){
	for(int x=0;x <= e-z*z*z-y*y;x++){
	  if( x + y*y + z*z*z == e){
	    if(f==0){
	       min = x+y+z;
	       f++;
	    }if(x+y+z<min){
	      min = x+y+z;
	    }
	      
	  }
	}
      }
    }
    cout << min << endl;
    cin >> e;
  }
  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main(void) {
	int e;
	while(1) {
		cin >> e;
		if(e == 0) {
			break;
		}
		
		int tmpx, tmpy, tmpz, tmpe;
		tmpe = e;
		tmpz = pow(e, 1.0 / 3.0);
		tmpe = tmpe - pow(tmpz, 3);
		if(tmpe == 0){
			tmpy = 0; tmpx = 0;
		}else{
			tmpy = pow(tmpe, 1.0 / 2.0);
			tmpe = tmpe - pow(tmpy, 2);
			if(tmpe == 0){
				tmpx = 0;
			}else{
				tmpx = tmpe;
			}
		}
		int tmpm = tmpx + tmpy + tmpz;

		int tmp, m = 100000;
		for(int z = 0; z <= tmpm; z++) {
			for(int y = 0; y <= pow(e - pow(z, 3), 1.0 / 2.0); y++) {
				int x = e - pow(y, 2) - pow(z, 3);
				tmp = x + y + z;
				if(tmp < m) {
					m = tmp;
				}
			}
		}

		cout << m << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#define min(a,b) a > b ? b : a

int pow(int n,int m){
	int sum = 1;
	for(int i = 0;i < m;i++)
		sum *= n;
	return sum;
}

int main(void){
	int y, z, e, m;
	while(1){
		scanf("%d",&e);
		if(e == 0)
			break;
		m = 0x7FFFFFFF;
		for(z = 0;pow(z,3) <= e;z++){
			for(y = 0;pow(y + 1,2) <= e - pow(z,3);y++);
			m = min((z + y + (e - pow(z,3) - pow(y,2))),m);
		}
		printf("%d\n",m);
	}
	return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };

int main() {
	int e;
	while (cin >> e, e){
		int minene = 1 << 15;
		REP(i, 101){
			REP(j, 1001){
				if (e < i*i*i + j*j)break;
				minene = min(i + j + e - (i*i*i + j*j), minene);
			}
			if (e < i*i*i)break;
		}
		cout << minene << endl;
	}
}