#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = {};
  int d = {};
  int value = {};
  std::vector<int> t;
  cin >> n >> d;
  for (int i = 0; i < n; i++) {
    cin >> value;
    t.push_back(value);
  }
  int res = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    if ((res + t[i]) > d) {
      cout << -1;
      return 0;
    } else if ((res + t[i]) <= d) {
      res += t[i];
      if ((res + 10) > d && i < (n - 1)) {
        cout << -1;
        return 0;
      } else if ((res + 10) <= d && i < (n - 1)) {
        res += 10;
        count += 2;
      }
    }
  }
  if (res < d) {
    int f = d - res;
    if (f >= 5) {
      res += f / 5;
      count += f / 5;
    }
  }
  cout << count;
  return 0;
}
