#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  ;
  long long n, k, ans = 0, m, j = 0, t = 0, x = 0, y = 0, c = 0, i, z = 0;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> x;
    m -= x;
  }
  k = 10 * (n - 1);
  if (m < k) return cout << -1, 0;
  ;
  m -= k;
  cout << 2 * (n - 1) + m / 5;
}
