import java.util.List; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Comparator; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.util.Collections; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author Praveen */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); TADELIVE solver = new TADELIVE(); solver.solve(1, in, out); out.close(); } } class TADELIVE { class Point { int a, b, diff; Point(int a, int b) { this.a = a; this.b = b; this.diff = Math.abs(a - b); } } public void solve(int testNumber, InputReader in, PrintWriter out) { int n = in.nextInt(); int x = in.nextInt(); int y = in.nextInt(); int sum = 0; int a[] = new int[n]; int b[] = new int[n]; for (int i = 0; i < n; i++) { a[i] = in.nextInt(); } for (int i = 0; i < n; i++) { b[i] = in.nextInt(); } List orders = new ArrayList<>(); for (int i = 0; i < n; i++) { orders.add(new Point(a[i], b[i])); } Collections.sort(orders, new Comparator() { @Override public int compare(Point o1, Point o2) { if (o1.diff < o2.diff) { return -1; } else if (o1.diff > o2.diff) { return 1; } else { return 0; } } }); Collections.reverse(orders); int ans = 0; for (int i = 0; i < n; i++) { Point p = orders.get(i); if (p.a > p.b) { if (x > 0) { x --; ans += p.a; } else { y --; ans += p.b; } } else { if (y > 0) { y --; ans += p.b; } else { x --; ans += p.a; } } } out.println(ans); } } class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } }