#include <bits/stdc++.h>
using namespace std;
int a[101];
int n, k;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[x]++;
  }
  int res = 0;
  while (a[k] != n) {
    for (int i = k - 1; i >= 1; i--)
      if (a[i]) {
        a[i + 1]++;
        a[i]--;
      }
    res++;
  }
  cout << res << endl;
}
