/* Author : linneszyx */ #include using namespace std; #define int long long int #define F first #define S second #define pb push_back #define si set #define vi vector #define pii pair #define vpi vector #define vpp vector> #define mii map #define mpi map #define spi set #define endl "\n" #define sz(x) ((int)x.size()) #define all(p) p.begin(), p.end() #define double long double #define forn(i, e) for (int i = 0; i < e; i++) #define forsn(i, s, e) for (int i = s; i < e; i++) #define rforn(i, s) for (int i = s; i >= 0; i--) #define rforsn(i, s, e) for (int i = s; i >= e; i--) #define que_max priority_queue #define que_min priority_queue> #define fast_cin() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) const int N = 1e5 + 5; const int mod = 1e9 + 7; int f(int n) { int s = 0; while (n != 1) { if (n % 2 == 0) n /= 2; else n = 3 * n + 1; s++; if (s > 50) { return -1; } } return s; } void waiffuu() { int n; cin >> n; int res = f(n); if (res == -1) { cout << "P(N) does not stop within 50 steps." << endl; } else { cout << "Number of stop steps for P(N): " << res << endl; } } int32_t main() { fast_cin(); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int t = 1; // cin >> t; while (t--) waiffuu(); return 0; }