#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, x, cnt = 0, a[105], dp[105] = {0};
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) dp[a[i]]++;
  while (dp[k] != n) {
    for (int i = k; i >= 1; i--) {
      if (dp[i] && i != k) {
        dp[i]--;
        dp[i + 1]++;
      }
    }
    cnt++;
  }
  printf("%d\n", cnt);
}
