#include using namespace std; using ll = long long; constexpr ll mod = 998244353; template struct Mint { using M=Mint; ll v; M& put(ll x) { v=(x>=1; } return res; } M inv() { return pow(mod-2); } }; using mint = Mint; int main(){ cin.tie(0); cin.sync_with_stdio(0); int n, m, w; cin >> n >> m >> w; vector a(n), b(m), c(m); for(int i = 0; i < n; ++i){ cin >> a[i]; } for(int j = 0; j < m; ++j){ cin >> b[j]; } for(int i = 0; i < m; ++i){ cin >> c[i]; } ll ans = 0; sort(a.begin(), a.end(), greater<>()); vector r(n + 1); for(int i = 0; i < n; ++i){ r[i + 1] = r[i] + a[i]; } auto add = [&](ll rem){ if(rem < r.size()){ return r[rem]; } else return r.back(); }; ll amax = *max_element(a.begin(), a.end()); for(int i = 0; i < (1 << m); ++i){ ll wei = 0, val = 0; for(int j = 0; j < m; ++j){ if(i & (1 << j)){ wei += b[j]; val += c[j]; } } if(wei <= w){ ans = max(ans, add(w - wei) + val); } } cout << ans << endl; }