#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 10, maxk = 100 + 10;
int n, k;
int ary[maxk];
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    ary[x]++;
  }
  int t = 0;
  while (ary[k] < n) {
    t++;
    for (int i = k + 1 - 1; i > 0; i--)
      if (ary[i - 1]) {
        ary[i]++;
        ary[i - 1]--;
      }
  }
  cout << t << endl;
  return 0;
}
