#include <fstream>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <queue>
#include <random>

using namespace std;

#define min(a,b) ((a)<(b) ? (a):(b))
#define max(a,b) ((a)>(b) ? (a):(b))

long long gcd(long long a, long long b){
    if(a<b){
        swap(a,b);
    }
    while(b){
        long long r = a%b;
        a=b;
        b=r;
    }
    return a;
}

int lcm(int a, int  b){
    return (a*b)/gcd(a,b);
}

int isPrim(int a){
    if(a==1){
        return 0;
    }
    for(int i=2;i<=(a+1)/2;i++){
        if(a%i==0){
            return 0;
        }
    }
    return 1;
}

long long mod_pow(long long x, long long n, long long mod){
    //x???n???????¨????????????????n??????2?????¨?¨???????????¨????
    //x^22 = x^16 + x^4 + x^2
    long long ret=1;
    while(n>0){
        if(n%2==1){
            ret=(ret*x)%mod;//???????????????
        }
        x=(x*x)%mod;//2???
        n=n/2;
    }
    return ret;
}

struct VV{
    int x;
    int y;
    int z;
};

class LessInt {
public:
    bool operator()(const VV& riLeft, const VV& riRight) const {
        if(riLeft.x == riRight.x){
            return riLeft.y > riRight.y;
        }
        return riLeft.x > riRight.x;
        
    }
};

class indInt {
public:
    bool operator()(const VV& riLeft, const VV& riRight) const {
        return riLeft.x < riRight.x;
        
    }
};

struct XX{
    int a=0;
    int b=0;
};

class xxIntu {
public:
    bool operator()(const XX& riLeft, const XX& riRight) const {
        //?¬¬2?????¶
        if(riLeft.a != riRight.a){
            return riLeft.b < riRight.b;//>:??????(?°?????????????????????????)???<:??????(??§????????????????????????)
        }
        //?¬¬1?????¶
        return riLeft.a < riRight.a;
    }
};
bool operator< (const VV &riLeft, const VV &riRight){
    return riLeft.z < riRight.z;
};
/*bool operator> (const XX &riLeft, const XX &riRight){
    return riLeft.a > riRight.a;
};*/

int funC(int a,int b){
    int tmp=1;
    int tmp2=1;
    for(int i=0;i<b;i++){
        tmp=tmp*(a-i);
        tmp2=tmp2*(b-i);
    }
    return tmp/tmp2;
}

int main(int argc, const char * argv[])
{
    //std::ios::sync_with_stdio(false);
    //scanf("%s",S);
    //scanf("%d",&N);
    //getline(cin, target);
    //cin >> x >> y;
    //???????????¨
    //ifstream ifs( "1_06.txt" );
    //ifs >> a;
    //????????????

    int N,M,K;
    cin >> N >> M >> K;
    XX x[15];
    int b[15];
    for(int i=0;i<N;i++){
        int tmp;
        cin >> tmp;
        x[i].a=tmp;
    }
    for(int i=0;i<N;i++){
        int tmp;
        cin >> tmp;
        x[i].b=tmp;
    }

    int ans=0;
    
    for(int i=0;i<1<<N;i++){
        vector<XX> hatake;
        hatake.clear();
        int tmp=0;
        for(int j=0;j<N;j++){
            if(i>>j & 1){
                hatake.push_back(x[j]);
            }
        }
        if(hatake.size()<=K){
            sort(hatake.begin(),hatake.end(),xxIntu());
            int ko=M;
            int i=0;
            while(ko!=0 && i<hatake.size()){
                if(hatake[i].b<=ko){
                    tmp=tmp+hatake[i].b*hatake[i].a;
                    ko-=hatake[i].b;
                }else{
                    tmp=tmp+ko*hatake[i].a;
                    ko=0;
                    break;
                }
                i++;
            }
            tmp=tmp+ko;
        }
        if(ans<tmp){
            ans=tmp;
        }
    }
    
    cout << ans << endl;

    
    //???????????§
    //cout << "ans" << endl;????????????
    //printf("%.0f\n",ans);//?°???°?????\?????¨?????????
    //printf("%.7f\n",p);
    //printf("%f\n",pow(2,ans.size()));
    
    return 0;
}

Measured memory_bytes: 3092