#include <bits/stdc++.h>
using namespace std;
int a[100];
int main() {
  int n, k;
  cin >> n >> k;
  set<int> s;
  for (int i = 0; i < n; i++) cin >> a[i], s.insert(a[i]);
  int cnt = 0;
  while (s.size() != 1 || *s.begin() != k) {
    set<int> ns;
    for (int i = 0; i < n; i++) {
      if (s.count(a[i]) && a[i] != k)
        s.erase(s.find(a[i])), a[i]++, ns.insert(a[i]);
      else
        ns.insert(a[i]);
    }
    s = ns;
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}
