/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/* Name of the class has to be "Main" only if the class is public. */
final class Order {
private final int andyTip;
private final int bobTip;
public Order(int andyTip, int bobTip) {
this.andyTip = andyTip;
this.bobTip = bobTip;
}
public int getAndyTip() {
return andyTip;
}
public int getBobTip() {
return bobTip;
}
public int getDifference() {
return andyTip - bobTip;
}
}
class Ideone
{
public static void main
(String[] args
) {
try (Scanner sc
= new Scanner
(System.
in)) { int n = sc.nextInt(); // Total number of orders
int x = sc.nextInt(); // Maximum orders Andy can take
int y = sc.nextInt(); // Maximum orders Bob can take
List<Integer> andyTips = IntStream.range(0, n).map(i -> sc.nextInt()).boxed().collect(Collectors.toList());
List<Integer> bobTips = IntStream.range(0, n).map(i -> sc.nextInt()).boxed().collect(Collectors.toList());
List<Order> orders = IntStream.range(0, n)
.mapToObj(i -> new Order(andyTips.get(i), bobTips.get(i)))
.collect(Collectors.toList());
orders.
sort(Comparator.
comparingInt(Order
::getDifference
).
reversed());
long maxTotalTip = 0;
int andyCount
= Math.
min(n, x
); int bobCount = n - andyCount;
long andyPortion = orders.stream().limit(andyCount).mapToLong(Order::getAndyTip).sum();
long bobPortion = orders.stream().skip(andyCount).mapToLong(Order::getBobTip).sum();
if (bobCount <= y) {
maxTotalTip = andyPortion + bobPortion;
}
for (int i = andyCount - 1; i >= 0; i--) {
Order orderToMove = orders.get(i);
// Simulate moving the order from Andy's list to Bob's.
andyPortion -= orderToMove.getAndyTip();
bobPortion += orderToMove.getBobTip();
bobCount++;
if (bobCount <= y) {
maxTotalTip
= Math.
max(maxTotalTip, andyPortion
+ bobPortion
); } else {
break;
}
}
System.
out.
println(maxTotalTip
); }
}
}