#include <bits/stdc++.h>
using namespace std;
int num[320];
int main() {
  int n, k;
  while (scanf("%d%d", &n, &k) != EOF) {
    for (int i = 0; i < n; i++) scanf("%d", &num[i]);
    sort(num, num + n);
    int god = 0;
    while (num[0] != k) {
      int pre = -1;
      for (int i = 0; i < n; i++) {
        if (num[i] == k) break;
        if (num[i] != pre) {
          pre = num[i];
          num[i]++;
        }
      }
      sort(num, num + n);
      god++;
    }
    printf("%d\n", god);
  }
}
