#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int n;double k;cin>>n>>k;
    double a[n];
    for(int i = 0;i<n;i++)
    cin>>a[i];    
    string s;cin>>s;
    for(int i=0;i<n;i++)
    if(s[i]=='1') a[i]*=0.95;
    sort(a,a+n);
    int ans=0;
    while(k>0)
    {
        if(k>=a[ans]) k-=a[ans++];
        else break;
    }
    cout<<ans;
    return 0;
}