#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll s; cin>>s; vector A; while(s){ ll a=sqrt(s); if((a+1)*(a+1)<=s){ A.push_back((a+1)*(a+1)); s-=(a+1)*(a+1); } else if(a*a<=s){ A.push_back(a*a); s-=a*a; } else{ A.push_back((a-1)*(a-1)); s-=(a-1)*(a-1); } } int b=A.size(); cout<