#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned short n, d, a, sum = 0;
  while (cin >> n >> d) {
    if (n == 0)
      break;
    else
      for (int i = 0; i < n; i++) {
        cin >> a;
        sum += a;
      }
    if (d >= (n - 1) * 10 + sum) {
      cout << (d - ((n - 1) * 10 + sum)) / 5 + (n - 1) * 2 << endl;
    } else
      cout << "-1" << endl;
  }
}
