#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
const double PI  = 3.1415926535897932384626433832795028841971;
const int    INF = 100000000;
const double EPS = 1e-10;
const int    MOD = 1000000007;
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n, m, k;
int a[15], b[15];
P c[15];

int main(){
	cin >> n >> m >> k;
    rep(i,n) cin >> a[i];
    rep(i,n) cin >> b[i];
    rep(i,n) c[i] = P(a[i],b[i]);
    int ans = 0;
    sort(c,c+n);
    rep(i,(1<<n)){
        int fl = 0, ii = i;
        vector<P> tmp;
        rep(j,n){
            if(ii&1){
                fl++;
                tmp.push_back(c[j]);
            }
            ii >>= 1;
        }
        if(fl > k) continue;
        sort(tmp.begin(),tmp.end(),greater<P>());
        int mm = m, cnt = 0;
        rep(j,tmp.size()){
            cnt += tmp[j].first*min(mm,tmp[j].second);
            mm -= tmp[j].second;
            if(mm <= 0) break;
        }
        ans = max(ans,cnt+max(mm,0));
    }
    cout << ans << endl;
}