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