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