#include <bits/stdc++.h>
using namespace std;
long long int x[1000007], y[1000007], z[1000007], n;
string s, S;
vector<long long int> v;
int main() {
  {
    long long int a = 0, b = 0, c = 0, d, e, f, g, i, j, k, l, m, p, q, r, u, w,
                  t, tc, in, mod, loc, diff, val, sz, lo, hi, mid,
                  mn = 2134567891, mx = 0, sum = 0, ans = 0;
    cin >> n >> m;
    for (i = 0; i < n; i++) {
      cin >> x[i];
      sum += x[i];
    }
    p = sum + (n - 1) * 10;
    if (p <= m)
      cout << (m - sum) / 5;
    else
      cout << "-1";
  }
  return 0;
}
