#include #include #include #include using namespace std; int solve(int n) { vector T; for (int t, i = 1; (t = i * (i + 1) / 2) <= n; i++) { T.emplace_back(t); } for (int t1 : T) { if (t1 == n) { return 1; } for (int t2 : T) { if (t1 + t2 == n) { return 2; } } } return 3; } int main() { int n; cin >> n; assert(n >= 1); assert(n <= 10000000); cout << solve(n) << endl; }