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;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD (ll)(1E9+7)
#define PI 3.1415926535897932384

template <class T>ostream &operator<<(std::ostream &o, const vector<T> &v)
{
	rep(i, v.size()) {
		o << (i > 0 ? " " : "") << v[i];
	}
	return o;
}



int main() {
	int e,n=1000000;
	while (1) {
		cin >> e;
		int min = INF;
		if (e == 0) break;
		for (int i = 0; i < e; i++) {
			for (int j = 0; j < (e-i); j++) {
				if (i*i + j*j*j > e) break;
				int x = e - (i*i + j*j*j);
				if (min > (i + j + x)) {
					min = i + j + x;
				}
			}
		}
		cout << min << endl;
	}
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main (int argc, char *argv[]) {
    int e;
    while (cin>>e, e) {
        int m = 1000000000;
        for (int z = 0; pow(z, 3) <= e; ++z) {
            for (int y = 0; pow(y, 2) <= e - pow(z, 3); ++y) {
                int x = e - pow(y, 2) - pow(z, 3);
                m = min(m, x + y + z);
            }
        }
        cout<<m<<endl;
    }
    return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;

int main(){
  int e;
  while(cin >> e){
    int x,y,z;
    int min = 10000;
    for(int i=0; i<=e; ++i){
      for(int j=0; j<=e; ++j){
	int tmp_j = j*j;
	if(tmp_j > e)break;
	for(int k=0; k<=e; ++k){
	  int tmp_k = k*k*k;
	  if(tmp_k > e)break;
	  if(e == i+tmp_j+tmp_k && min > i+k+j){
	    min = i+j+k;
	  }
	}
      }
    }

    cout << min << endl;
  }
  return 0;
}

C++: #include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>

using namespace std;


int main(){

	int e,minimum;

	while(true){
		scanf("%d",&e);
		if(e == 0)break;

		minimum = 10000000;

		for(int z = 0; z*z*z <= e;z++){
			for(int y = 0; y*y <= e-z*z*z; y++){
				minimum = min(minimum,y+z+(e-(z*z*z+y*y)));
			}
		}
		printf("%d\n",minimum);
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int e,m;
  int E,z;
  int mn=1000000;
  while(1){
    mn=1000000;
    cin>>e;
    if(e==0) break;
    for(int i=0;i*i*i<=e;i++){
      for(int j=0;(j*j)+(i*i*i)<=e;j++){
	z=e-(i*i*i)-(j*j);
	mn=min(mn,i+j+z);
      }
    }	 
  cout<<mn<<endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;

int main()
{
	int e;
	while(cin>>e && e!=0){
		int ans=e;
		for(int z=0;z<=e;z++){
			if(z*z*z>e) break;
			if(z>=ans) break;
			for(int y=0;y<=e;y++){
				if(z+y>=ans) break;
				if(z*z*z+y*y>e) break;
				for(int x=0;x<=e;x++){
					if(x+y+z>=ans) break;
					if(x+y*y+z*z*z>e) break;
					if(x+y*y+z*z*z==e){
						ans=x+y+z;
					}
				}
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <iostream>

#define FOR(i,l,n) for(int (i)=(l);(i)<(n);(i)++)
#define REP(i,n) FOR(i,0,n)

#define MAX_Y 1000
#define MAX_Z 100
using namespace std;

int main(){
    long int x,y,z,e,m=1000000;
    while(cin>>e,e){
        FOR(y,1,MAX_Y+1){
            FOR(z,1,MAX_Z+1){
                x = e-pow(z,3)-pow(y,2);
                if(x>=0&&x+y+z<m)m=x+y+z;
            }
        }
        cout<<m<<endl;
    }
    return 0;
}

C++: #include <cstdio>

void aizu(int e){
    int x, y, z;

    for(int xyz = 1; xyz <= e; xyz++){
        for(x = 0; x <= xyz; x++){
            for(y = 0; x + y <= xyz; y++){
                z = xyz - x - y;
                if(x + y * y + z * z * z == e){
                    printf("%d\n", xyz);
                    return;
                }
            }
        }
    }
}

int main(void)
{
    for(int e; scanf("%d", &e), e != 0;){
        aizu(e);
    }
    return 0;
}

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

int main()
{
loop:
  int e, x, y, z, m = 1 << 30;
  cin >> e;
  if(!e)
    return 0;
  for(int z = 0; pow(z, 3) <= e; z++)
  {
    y = (int)sqrt(e - pow(z, 3));
    m = min(z + y + (int)(e - pow(z, 3) - pow(y, 2)), m); 
  }
  cout << m << endl;
  goto loop;
}

C++: #include<iostream>
using namespace std;
int e,x,y,MIN,i,j;
int main(){
	while(true){
		MIN=1<<27;
		cin>>e;if(!e){break;}
		for(i=0;i*i*i<=e;i++){
			for(j=0;j*j+i*i*i<=e;j++){
				MIN=min(MIN,i+j+e-(i*i*i+j*j));
			}
		}
		cout<<MIN<<endl;
	}
}

C++: #include <iostream>
#include <algorithm>
#include <utility>
#include <cmath>
using namespace std;

int main(void){

  int e;

while(1){
    cin >> e;
    int ans = 100000000;
    if(e == 0) break;
      for(int y=0; y <= sqrt(e); y++){
	for(int z=0;z <= cbrt(e); z++){
	int x = e - y*y - z * z * z;
	  if(e == x + y*y + z*z*z && x >= 0){
	    ans = min(ans,x+y+z);
	    //cout << x << ' ' << y << ' ' << z << endl;
	  }
	}
      }

    cout << ans << endl;

 }
  return 0;
}

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

int main() {
	int e, m, a, x;
	double c, d;
	while (true) {
		cin >> e;
		if (e == 0) break;
		m = 90000000;

		c = pow(e, 1.0 / 3.0);
		d = sqrt(e);
		for (int z = 0; z <= c; z++) {
			for (int y = 0; y <= d; y++) {	
				x = e - y*y - z*z*z;
				if (x < 0) break;
				else {
					a = x + y + z;
					if (a < m) m = a;
				}
			}
		}

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

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

using namespace std;

int main(){
	
	while(1){
		
		long e;
		cin >> e;
		if(e==0) break;
		long ans=1000000;
		long tz,x;
		
		for(long z=0;e>=z*z*z;z++){
			tz=e-z*z*z;
			for(long y=0;tz>=y*y;y++){
				x=tz-y*y;
				ans=min(ans,x+y+z);
			}
		}
		
		cout << ans << endl;
	}
	return 0;
}

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


int main() {
    int e;
    while(cin >> e, e) {
        int ret = 1e9;
        for(int y=0; y*y<=e && y<=1000; ++y) {
            for(int z=0; z*z*z<=e-y*y && z<=100; ++z) {
                int x = e - y*y - z*z*z;
                ret = min(ret, x + y + z);
            }
        }
        cout << ret << endl;
    }
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int n;
  int m=1000001;
  int k;
  while(1){
    m=1000001;
    cin >> n;
    if(n==0)break;
    for(int i=0;i*i*i<=n;i++){
      if(n-i*i*i==0){
	m=min(m,i);
	continue;
      }
      for(int j=0;i*i*i+j*j<=n;j++){
	k=n-(i*i*i+j*j);
	//	cout << k << " "<< j <<" "<<i<< endl;
	m=min(m,i+j+k);
      }
    }    
    cout << m << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<math.h>
#include <limits.h>
using namespace std;
int count = 0;
int solve(int E)
{
  int ans =1000000;
  for (int x=0; x<=E; ++x)
    for (int y=0; y*y<=E; ++y)
      {
	//cout<<"y="<<y<<endl;
	int z=(int)round(pow(E-x-y*y,1.0/3));
	//cout<<"z="<<z<<endl;
	if (x+y*y+z*z*z == E)
	{
	  if((x+y+z)<ans)
	  {
	    ans=x+y+z;
	    // cout<<ans<<endl;
	  }
	}
      }
  return ans;
}
int main()
{
  int E;
  while (cin >> E && E>0)
  {
    cout << solve(E) << endl;
  }
}