/*
贪心,很明显是越容易升级的越先升级
*/
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn = ;
int n,k,t,a[maxn],lv[maxn],ans;
int read(){
char ch=getchar();
int x=,f=;
while(!(ch>=''&&ch<='')){if(ch=='-')f=-;ch=getchar();};
while(ch>=''&&ch<=''){x=x*+(ch-'');ch=getchar();};
return x*f;
}
bool cmp(int a,int b){
return (a % ) > (b % );
}
int main(){
freopen("science.in","r",stdin);
freopen("science.out","w",stdout);
n = read();
k = read();
for(int i = ;i <= n;i++) a[i] = read();
sort(a+,a++n,cmp);
for(int i = ;i <= n;i++){
lv[i] = a[i] / ;
t = - (a[i] % );
if(k >= t && lv[i] <= ){
k -= t;
lv[i]++;
a[i] = ;
}
}
for(int i = ;i <= n;i++){
if(lv[i] <= ){
t = min(-lv[i],k/);
lv[i] += t;
k -= t*;
}
ans += lv[i];
}
cout<<ans;
return ;
}