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