#include <bits/stdc++.h>
using namespace std;
int arr[105];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    arr[x]++;
  }
  bool exit = false;
  int ans = 0;
  while (!exit) {
    exit = true;
    for (int i = k - 1; i > 0; i--) {
      if (arr[i] == 0) continue;
      exit = false;
      arr[i]--;
      arr[i + 1]++;
    }
    if (!exit) ans++;
  }
  cout << ans << endl;
}
