#include <bits/stdc++.h>
using namespace std;
int arr[1005], half;
pair<int, int> info[1005];
bool cmp(pair<int, int> A, pair<int, int> B) {
  if (A.first == B.first)
    return A.second < B.second;
  else
    return A.first < B.first;
}
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", arr + i);
    half = arr[i] / 2 + (arr[i] % 2);
    info[i] = pair<int, int>(half, arr[i]);
  }
  sort(info, info + n, cmp);
  int lvl = k, cnt = 0;
  for (int i = 0; i < n; i++) {
    if (info[i].first <= lvl) {
      lvl = max(k, info[i].second);
    } else {
      int num = info[i].second;
      while (lvl < num) {
        num = (num / 2) + (num % 2);
        if (lvl < num) cnt++;
      }
      lvl = info[i].second;
    }
  }
  printf("%d", cnt);
}
