#include <iostream>
using namespace std;

int main(int argc, char** argv) {
  short n, x, r ;

  cout << "Enter your number" << endl ;
  cin >> n ;
    
  x = n ;
  r = 0 ;
  while (x != 1) {
    if (x%2 == 1) {
      x = 3*x + 1 ;
    } else {
      x = x/2 ;
    }
    r = r + 1 ;
  }

  cout << r << " iterations required for " << n << endl ;

  return 0;
}
