#include using namespace std; int f(int n) { return n * (n + 1) / 2; } int main() { int n; cin >> n; int ans = 3; for (int i = 1; f(i) <= n; i++) { if (f(i) == n) ans = 1; int t = n - f(i); for (int j = i; f(j) <= t; j++) { if (f(j) == t) { ans = min(ans, 2); } } } cout << ans << endl; return 0; }