#include using namespace std; using i64 = int64_t; int main(){ i64 N; cin >> N; auto countShade = [N](i64 showCnt) -> bool { i64 height = N - showCnt; height -= (N - 1 - height) * 2; for(i64 baseHeight = N; baseHeight >= N-showCnt+3; baseHeight--){ if(height <= 0) return true; height -= (baseHeight - 3 - height) * 2 + 3; } return height <= 0; }; i64 c = 1; while(!countShade(c)) c++; cout << (N-c) << '\n'; return 0; }