#include #define rep(i, n) for (int i = 0; i < (n); i++) #define repr(i, n) for (int i = (n) - 1; i >= 0; i--) #define range(a) a.begin(), a.end() using namespace std; using ll = long long; int main() { int n; cin >> n; int mx = n; for (int i = 0;; i++) { if (n == 1) { cout << i << endl; cout << mx << endl; break; } n = n % 2 == 0 ? n / 2 : 3 * n + 1; mx = max(mx, n); } }