#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
template<typename T, typename U> static void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> static void amax(T &x, U y) { if(x < y) x = y; }

int main() {
	int N; int M; int K;
	while(~scanf("%d%d%d", &N, &M, &K)) {
		vector<int> a(N);
		for(int i = 0; i < N; ++ i)
			scanf("%d", &a[i]);
		vector<int> b(N);
		for(int i = 0; i < N; ++ i)
			scanf("%d", &b[i]);
		vpii ab;
		int ans = 0;
		rep(s, 1 << N) {
			ab.clear();
			rep(i, N) if(s >> i & 1) {
				ab.emplace_back(-a[i], b[i]);
			}
			if((int)ab.size() > K) continue;
			sort(ab.begin(), ab.end());
			int rem = M, sum = 0;
			for(auto p : ab) {
				int num = min(rem, p.second);
				sum += num * -p.first;
				rem -= num;
			}
			sum += rem;
			amax(ans, sum);
		}
		printf("%d\n", ans);
	}
	return 0;
}