#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
inline long long toll(string s) {
  long long v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
int dcmp(double x, double y) {
  return fabs(x - y) <= 1e-9 ? 0 : x < y ? -1 : 1;
}
void printV(vector<long long> v) {
  for (int i = 0; i < v.size(); i++) {
    if (i) {
      cout << " " << v[i];
    } else
      cout << v[i];
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  long long lo = 1;
  long long hi = (1LL << n) - 1LL;
  long long steps = 0;
  while (lo < hi) {
    long long mid = ((hi + lo) >> 1LL);
    if (mid == k) {
      break;
    }
    if (k > mid) {
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
    steps++;
  }
  cout << n - steps;
  return 0;
}
