#include <bits/stdc++.h>
using namespace std;
int organizeFunc(vector<int> songs, int timeLeft) {
  int count = 0;
  for (int i = 0; i < songs.size(); i++) {
    if (songs[i] <= timeLeft) {
      if (i < songs.size() - 1) {
        timeLeft -= songs[i] + 10;
        count += 2;
      } else
        timeLeft -= songs[i];
    } else
      return -1;
  }
  return timeLeft / 5 + count;
}
int n, d;
int main() {
  cin >> n >> d;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  cout << organizeFunc(v, d);
  return 0;
}
