#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > pos;
vector<pair<long long, long long> > neg;
int main() {
  long long n, d, x;
  cin >> n >> d;
  long long curr;
  cin >> curr;
  bool pop = true;
  if (curr > d) pop = false;
  long long ans = 0;
  for (long long i = 2; i <= n; i++) {
    cin >> x;
    if (curr + x + 10 > d) {
      pop = false;
    } else {
      curr += x + 10;
      ans += 2;
    }
  }
  if (!pop)
    cout << "-1" << endl;
  else {
    ans += (d - curr) / 5;
    cout << ans << endl;
  }
}
