#include <bits/stdc++.h>
using namespace std;
long long res, mini, minj, maxi, maxj, a, b, c, d, e, f, g, h, i, j, k, l, m, n,
    o, p, q, r, s, t, u, v, w, x, y, z;
long long aa[107], bb[107], cc[107], dd[107];
string s1, s2, s3, s4, s5, s6, s7, s8, s9, s0;
char c1, c2, c3, c4, c5, c6, c7, c8, c9, c0;
int main() {
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> aa[i];
    a += aa[i];
  }
  if (a + 10 * (n - 1) > m) {
    cout << -1 << endl;
    return 0;
  }
  if (a + 10 * (n - 1) == m) {
    b = m - a;
    cout << b / 5 << endl;
  } else {
    b = m - a;
    cout << b / 5 << endl;
  }
  return 0;
}
