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