#include <bits/stdc++.h>
int main() {
  int n, d, s = 0, j = 0, l = 0;
  scanf("%d%d", &n, &d);
  int a[n];
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) {
    if (s + a[i] <= d) {
      s = s + a[i];
      l++;
    }
    if (s + 10 <= d) {
      j = j + 2;
      s = s + 10;
    } else if (s + 5 <= d) {
      s = s + 5;
      j = j + 1;
      break;
    }
  }
  if (l == n) {
    j = j + (d - s) / 5;
    printf("%d", j);
  } else
    printf("-1");
  return 0;
}
