#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define X first #define Y second #define pb push_back #define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X)) #define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X)) #define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X)) #define repe(X,Y) for ((X) = 0;(X) < (Y);++(X)) #define peat(X,Y) for (;(X) < (Y);++(X)) #define all(X) (X).begin(),(X).end() #define rall(X) (X).rbegin(),(X).rend() #define eb emplace_back #define UNIQUE(X) (X).erase(unique(all(X)),(X).end()) using namespace std; typedef long long ll; typedef pair pii; typedef pair pll; int main() { ll s; cin >> s; for (ll i = 0; i < s; ++i) { if (i < 1e3 && s <= 3 * (i + 1e3) * (i + 1e3)) { cout << i << endl; return 0; } if (i >= 1e3 && 3*(i-1e3)*(i-1e3) <= s && s <= 3*(i+1e3)*(i+1e3)) { cout << i << endl; return 0; } } return 0; }