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