#include <bits/stdc++.h>
using namespace std;
template <class P, class Q>
inline bool mmin(P &a, Q b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class P, class Q>
inline bool mmax(P &a, Q b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const int MAXn = 100 * 1000;
int n, d;
int ar[MAXn];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> d;
  int sum = 0, ans = 0;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    sum += x;
    if (i < n - 1) sum += 10, ans += 2;
  }
  if (sum > d)
    cout << -1 << endl;
  else
    cout << ans + (d - sum) / 5 << endl;
  return 0;
}
