import java.io.*; import java.util.*; import java.util.function.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int m = sc.nextInt(); long w = sc.nextLong(); int[] values = new int[n]; for (int i = 0; i < n; i++) { values[i] = sc.nextInt(); } Arrays.sort(values); int[] weight = new int[m]; for (int i = 0; i < m; i++) { weight[i] = sc.nextInt(); } TreeMap worth = new TreeMap<>(); worth.put(0L, 0L); for (int i = 0; i < m; i++) { int x = sc.nextInt(); Long key = Long.MAX_VALUE; while ((key = worth.lowerKey(key)) != null) { if (worth.floorEntry(key + weight[i]).getValue() >= worth.get(key) + x) { continue; } worth.put(key + weight[i], worth.get(key) + x); Long current = key + weight[i]; while ((current = worth.higherKey(current)) != null) { if (worth.get(current) <= worth.get(key) + x) { worth.remove(current); } else { break; } } } } long ans = worth.floorEntry(w).getValue(); long current = 0; for (int i = 1; i <= n; i++) { current += values[n - i]; ans = Math.max(ans, worth.floorEntry(w - i).getValue() + current); } System.out.println(ans); } } class Scanner { BufferedReader br; StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() { try { br = new BufferedReader(new InputStreamReader(System.in)); } catch (Exception e) { } } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String next() { try { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } } catch (Exception e) { e.printStackTrace(); } finally { return st.nextToken(); } } }