#include #define rep(i, n) for (ll i = 0; i < n; ++i) typedef long long ll; using namespace std; const int INF = 1e9; int main() { ll a; cin >> a; int cnt = 0; ll ans = a; while (1) { if (a == 1) break; if (a % 2 == 0) a /= 2; else a = 3 * a + 1; ans = max(ans, a); cnt++; } cout << cnt << endl << ans << endl; return 0; }