#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s1, s2;
  int i = 0, j = 0, k = 0, l = 0;
  int a[10000], b[10000], c[10000];
  int y2 = 0, y = 0, x = 0, x2 = 0;
  bool flag = 0;
  set<int> w;
  int q[5000];
  int n, d, sum = 0, nsum = 0;
  cin >> n;
  cin >> d;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  nsum = sum;
  while (sum < d && x2 < n - 1) {
    x2++;
    sum = sum + 10;
    l++;
  }
  if (sum <= d) {
    sum = sum + 5;
    x++;
  }
  if (nsum + (n - 1) * 10 > d) {
    cout << -1;
    return 0;
  } else {
    while (sum <= d) {
      sum = sum + 5;
      x++;
    }
    cout << 2 * l + (--x);
  }
  return 0;
}
