#include <bits/stdc++.h>
using namespace std;
int toNumber(string s) {
  int Number;
  if (!(istringstream(s) >> Number)) Number = 0;
  return Number;
}
string toString(int number) {
  ostringstream ostr;
  ostr << number;
  return ostr.str();
}
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  unsigned long long n, k;
  cin >> n >> k;
  vector<unsigned long long> a;
  unsigned long long ans = 0;
  unsigned long long al100 = 0;
  int tot = 0;
  for (int i = 0; i < (int)(n); i++) {
    int p;
    cin >> p;
    tot += p;
    if (p % 10) {
      a.push_back(10 - p % 10);
      ans += p / 10;
      al100 += 10 - (p / 10) - 1;
    } else {
      if (p == 100) {
        ans += 10;
        continue;
      }
      a.push_back(10);
      ans += p / 10;
      al100 += (10 - (p / 10) - 1);
    }
  }
  if (tot + k >= 100 * n) {
    cout << 10 * n;
    return 0;
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < (int)(a.size()); i++) {
    if (a[i] > k) break;
    k -= (a[i]);
    ans++;
  }
  ans += k / 10;
  cout << ans;
}
