#include <bits/stdc++.h>
using namespace std;
int n, d, total;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> d;
  for (int i = 0; i < n; i++) {
    int buf;
    cin >> buf;
    total += buf;
  }
  if ((n - 1) * 10 + total > d) {
    cout << -1 << endl;
  } else {
    cout << (d - total) / 5 << endl;
  }
  return 0;
}
