#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, sum = 0, check = 0;
  cin >> n >> m;
  int* x = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    sum += x[i];
  }
  if (sum + ((n - 1) * 10) > m) {
    cout << -1;
    return 0;
  }
  int z = (m - sum) / 5;
  cout << z;
}
