#include void solve() { int n; std::cin >> n; int ans = 3; for (int x = 1; x * (x + 1) / 2 <= n; ++x) { int dx = x * (x + 1) / 2; if (n == dx) ans = 1; for (int y = 1; y * (y + 1) / 2 + dx <= n; ++y) { int dy = y * (y + 1) / 2; if (n == dx + dy) ans = std::min(ans, 2); } } std::cout << ans << "\n"; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }