#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> ar(n + 1);
  for (int i = 1; i <= n; ++i) {
    cin >> ar[i];
  }
  sort(ar.begin() + 1, ar.end());
  reverse(ar.begin() + 1, ar.end());
  for (int i = 1; i <= n; ++i) {
    vector<pair<long long, int>> br(n + 1);
    for (int j = 1, f = 1; j <= n; ++j) {
      if (f == i + 1) f = 1;
      br[f].first += max(0, ar[j] - br[f].second++);
      ++f;
    }
    int tmp = 0;
    for (int j = 1; j <= n; ++j) {
      tmp += br[j].first;
    }
    if (tmp >= m) {
      cout << i << "\n";
      return 0;
    }
  }
  cout << -1 << '\n';
  return 0;
}
