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