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 <bits/stdc++.h>
using namespace std;


// type {{{
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<int,int>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<ll>>;
// }}}


// macro {{{
#define rep(i,n) for (ll i=0, i##_len=(n); i<i##_len; ++i)
#define reps(i,n) for (ll i=1, i##_len=(n); i<=i##_len; ++i)

#define SZ(x) ((ll)(x).size())

#define all(x) begin(x),end(x)
// }}}


// Debug {{{
#define dump(x) cerr<<#x<<" = "<<(x)<<endl
#define debug(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "[";
    rep (i, SZ(v)) {
        if (i) os << ", ";
        os << v[i];
    }
    return os << "]";
}

template<typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    return os << "(" << p.first << " " << p.second << ")";
}
// }}}


// chmax, chmin {{{
template<class T>
bool chmax(T& a, const T& b) {
    if (a < b) { a = b; return true; }
    return false;
}
template<class T>
bool chmin(T& a, const T& b) {
    if (b < a) { a = b; return true; }
    return false;
}
// }}}



// constants {{{
#define inf(T) numeric_limits<T>::max()

const ll MOD = 1e9+7;
const ld EPS = 1e-9;
// }}}


int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    for (;;) {
        int e; cin >> e;
        if (e == 0) break;
        int m = inf(int);
        for (int z = 0; z*z*z <= e; ++z) {
            for (int y = 0; z*z*z + y*y <= e; ++y) {
                int x = e - (z*z*z + y*y);
                chmin(m, x + y + z);
            }
        }
        cout << m << endl;
    }

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

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

    }
}

C++: #include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define ALL(a) (a).begin(),(a).end()
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define rep(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
 
using namespace std;
 
 
int main(){
  int e;
  while(cin>>e,e){
		int ans = 1 << 20;
        for(int i = 0;i*i*i<=e;i++){
					int yyx  = e - i*i*i;
					int y = (int)sqrt(yyx);
					ans = min(yyx-y*y+y+i,ans);
				}
				cout << ans << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main()
{
  int x,y,z,m;
  double e;
  while(cin>>e,e){
    m=1000000;
    for(z=0;z*z*z<=e;z++){
      y=(int)pow(e-z*z*z,1.0/2.0);
      x=e-y*y-z*z*z;
      if(m>x+y+z)m=x+y+z;
      //      cout<<x<<" "<<y<<" "<<z<<" "<<m<<endl;
    }
    cout<<m<<endl;
  }
}

C++: #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
  int E,tmp,z,y,x,i;
  while (cin >> E && E>0){
    if (E>1000000){
    cout << "Incorrect input" << endl;
    exit(1);
    }
    for (i=0;i*i*i<=E;i++){
    }
    i--;
    z=i;
    tmp = E-z*z*z;
    for (i=0;i*i<=tmp;i++){
    }
    i--;
    y=i;
    x=tmp-y*y;
    cout << x+y+z << endl;
  }
}

C++: #include <iostream>
#include <math.h>

using namespace std;

int main()
{
    int e;
    while (cin >> e && e > 0)
    {
        int minimum = 1000000;
        for (int z = 0; pow(z, 3) <= e; z++)
        {
            int x = 0, y = 0;
            y = sqrt(e - pow(z, 3));
            x = e - pow(z, 3) - pow(y, 2);
            minimum = min(minimum, x + y + z);
        }
        cout << minimum << endl;
    }

    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
    int64_t e;
    while(cin >> e && e > 0){
        int64_t x = 0, y = 0, z = 0, m = 1000;
		for (z = 0; z * z * z <= e; z++){
			for (y = 0; y * y + z * z * z <= e; y++){
			    x = e - y * y - z * z * z;
				m = min (m, x + y + z);
			}
		}
        cout << m << endl;
    }
    return 0;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <cassert>

using namespace std;


bool solve(){
	int n;
	cin>> n;
	if(!n) return false;
	int ans = 1000000;
	for(int k=n;k>=0;k--){
		if(k*k*k > n) continue;	
		for(int j=n;j>=0;j--){
			if(j*j + k*k*k > n) continue;
			int i = n - j*j - k*k*k;
			if(0 <= i && i <= n){
				int m = i+j+k;
				ans = min(ans, m);
			}
		}
	}
	cout<< ans<< endl;
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	while(solve());

	return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
typedef long long ll;

int solve(const ll &e) {
  ll m = 1e6;
  for (ll z = 0; z <= e; z++) {
    ll zzz = pow(z, 3);
    if (zzz > e) break;
    for (ll y = 0; y <= e - zzz; y++) {
      ll yy = pow(y, 2);
      if (yy > e - zzz) break;
      int x = e - zzz - yy;
      m = min(m, x + y + z);
    }
  }
  return m;
}

int main() {
  ll e;
  while (cin >> e && e > 0) {
    cout << solve(e) << endl;
  }
  return 0;
}

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

using namespace std;

int main() {
	int hyou[11];
	for (int i = 0; i < 11; i++) {
		hyou[i] = i*i*i;
	}
	int e;
	while (cin >> e) {
		if (e == 0) {
			break;
		}
		int a, b, c;
		for (int i = 10; i > 0; i--) {
			if (e >= hyou[i]) {
				c = i;
				break;
			}
		}
		for (int i = 1; ;i++) {
			if (i*i > e-hyou[c]) {
				b = i-1;
				break;
			}
		}
		for (int i = 1; ;i++) {
			if (i > e-hyou[c]-b*b) {
				a = i-1;
				break;
			}
		}
		int MIN = a+b+c;
		for (int i = 0; ;i++) {
			if (i >= MIN) {
				break;
			}
			for (int j = 0; ;j++) {
				if (i+j >= MIN) {
					break;
				}
				for (int k = 0; k <= c; k++) {
					if (i+j*j+hyou[k] == e) {
						MIN = min(MIN, i+j+k);
					} else if (i+j*j+hyou[k] > e) {
						break;
					}
				}
			}
		}
		cout << MIN << endl;
	}
	return 0;
}

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

using namespace std;

#define LOG(...) fprintf(stderr,__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(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(a) ((int)(a).size())
#define BIT(x, i) (((x) >> (i)) & 1)

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;

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