Igor found out discounts in a shop and decided to buy n items. Discounts at the store will last for a week and Igor knows about each item that its price now is ai, and after a week of discounts its price will be bi.

Not all of sellers are honest, so now some products could be more expensive than after a week of discounts.

Igor decided that buy at least k of items now, but wait with the rest of the week in order to save money as much as possible. Your task is to determine the minimum money that Igor can spend to buy all n items.

Input

In the first line there are two positive integer numbers n and k (1 ≤ n ≤ 2·105, 0 ≤ k ≤ n) — total number of items to buy and minimal number of items Igor wants to by right now.

The second line contains sequence of integers a1, a2, ..., an (1 ≤ ai ≤ 104) — prices of items during discounts (i.e. right now).

The third line contains sequence of integers b1, b2, ..., bn (1 ≤ bi ≤ 104) — prices of items after discounts (i.e. after a week).

Output

Print the minimal amount of money Igor will spend to buy all n items. Remember, he should buy at least k items right now.

Examples

Input

3 1
5 4 6
3 1 5


Output

10


Input

5 3
3 4 7 10 3
4 5 5 12 5


Output

25

Note

In the first example Igor should buy item 3 paying 6. But items 1 and 2 he should buy after a week. He will pay 3 and 1 for them. So in total he will pay 6 + 3 + 1 = 10.

In the second example Igor should buy right now items 1, 2, 4 and 5, paying for them 3, 4, 10 and 3, respectively. Item 3 he should buy after a week of discounts, he will pay 5 for it. In total he will spend 3 + 4 + 10 + 3 + 5 = 25.
import java.util.*;
import java.io.*;
import java.math.*;
public class Fuck{
	static long mod=(long)Math.pow(10,9)+7;
	static final int lint=Integer.MAX_VALUE;
	static final double ldouble=Double.MAX_VALUE;
	public static void main(String args[]) {
        new Thread(null, new Runnable() {
            public void run() {
                try{
                    solve();
                }
                catch(Exception e){
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();
	}
	public static void solve(){
		InputReader in = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        TreeMap<Integer,ArrayList<Integer>> diff=new TreeMap<Integer,ArrayList<Integer>>();
        TreeSet<Integer> check=new TreeSet<Integer>();
        int n=in.nextInt();
        int k=in.nextInt();
        int a[]=new int[n];
        for(int i=0;i<n;i++){
        	a[i]=in.nextInt();
        }
        int b[]=new int[n];
        for(int i=0;i<n;i++){
        	b[i]=in.nextInt();
        	int di=a[i]-b[i];
        	if(diff.containsKey(di)){
        		ArrayList<Integer> temp=diff.get(di);
        		temp.add(i);
        		diff.put(di,temp);
        	}else{
        		ArrayList<Integer> temp=new ArrayList<Integer>();
        		temp.add(i);
        		diff.put(di,temp);
        	}
        }
        long sum=0;
//        System.out.println("jack");
        while(k>0){
        	int key=diff.firstKey();
//        	System.out.println(key+" "+k);
        	ArrayList<Integer> value=diff.get(key);
        	int temp=0;
        	for(int i=0;i<value.size();i++){
        		k--;
        		if(k<0){
        			break;
        		}
        		check.add(value.get(i));
        		sum+=a[value.get(i)];
        		temp++;
        	}
        	if(temp==value.size()){
        		diff.remove(key);
        	}
        }
//        System.out.println(sum);
        while(!diff.isEmpty()&&diff.firstKey()<=0){
        	int key=diff.firstKey();
        	ArrayList<Integer> value=diff.get(key);
        	int temp=0;
        	for(int i=0;i<value.size();i++){
        		if(!check.contains(value.get(i))){
        			check.add(value.get(i));
        			sum+=a[value.get(i)];
        		}
        		temp++;
        	}
        	if(temp==value.size()){
        		diff.remove(key);
        	}
        }
        while(!diff.isEmpty()){
        	int key=diff.firstKey();
        	ArrayList<Integer> value=diff.get(key);
        	int temp=0;
        	for(int i=0;i<value.size();i++){
        		if(!check.contains(value.get(i))){
        			check.add(value.get(i));
        			sum+=b[value.get(i)];
        		}
        		temp++;
        	}
        	if(temp==value.size()){
        		diff.remove(key);
        	}
        }
        w.println(sum);
        w.close();
    }
//	static boolean isPrime[];
//	 //for marking all prime numbers greater than 1 and less than equal to N
//	static void sieve(int N) {
//      isPrime=new boolean[N+1];
//      isPrime[0] = true;
//      isPrime[1] = true;
//      for(int i = 2; i * i <= N; ++i) {
//           if(isPrime[i] == false) {//Mark all the multiples of i as composite numbers
//               for(int j = i * i; j <= N ;j += i)
//                   isPrime[j] = true;
//          }
//      }
//  }
//	static boolean isPrime(long n) {
//		if(n < 2L) return false;
//		if(n == 2L || n == 3L) return true;
//		if(n%2L == 0 || n%3L == 0) return false;	
//		long sqrtN = (long)Math.sqrt(n)+1L;
//		for(long i = 6L; i <= sqrtN; i += 6L) {
//			if(n%(i-1) == 0 || n%(i+1) == 0) return false;
//		}
//		return true;
//	}
	static HashMap<Integer,Integer> level=new HashMap<Integer,Integer>();
	static HashMap<Integer,Integer> parent=new HashMap<Integer,Integer>();
 
	static ArrayList<Integer> adj[]; //Adjacency Lists
    static int V;   // No. of vertices
    // Constructor
    static void Graph(int v){
        V = v;
        adj = new ArrayList[v];
        for (int i=0; i<v; ++i){
        	adj[i] = new ArrayList();
        }
    }
    // Function to add an edge into the graph
    static void addEdge(int v,int w){
		adj[v].add(w);
		adj[w].add(v);
    }
    static void bfs(int n){
    	LinkedList<Integer> queue=new LinkedList<Integer>();
    	queue.add(0);
    	parent.put(0,0);
    	level.put(0,0);
    	boolean visited[]=new boolean[n];
    	visited[0]=true;
    	while(!queue.isEmpty()){
    		int num=queue.pop();
    		int l=level.get(num);
    		for(int i=0;i<adj[num].size();i++){
    			if(!visited[adj[num].get(i)]){
    				visited[adj[num].get(i)]=true;
    				queue.add(adj[num].get(i));
    				parent.put(adj[num].get(i), num);
    				level.put(adj[num].get(i),l+1);
    			}
    		}
    	}
    }  
//	static boolean T[][][];
//	static void subsetSum(int input[], int total, int count) {
//        T = new boolean[input.length + 1][total + 1][count+1];
//        for (int i = 0; i <= input.length; i++) {
//        	T[i][0][0] = true;
//        	for(int j = 1; j<=count; j++){
//        		T[i][0][j] = false;
//        	}
//        }
//        int sum[]=new int[input.length+1];
//        for(int i=1;i<=input.length;i++){
//            sum[i]=sum[i-1]+input[i-1];
//        }
//        for (int i = 1; i <= input.length; i++) {
//            for (int j = 1; j <= (int)Math.min(total,sum[i]); j++) {
//            	for (int k = 1; k <= (int)Math.min(i,count); k++){
//            		 if (j >= input[i - 1]) {//Exclude and Include
//                         T[i][j][k] = T[i - 1][j][k] || T[i - 1][j - input[i - 1]][k-1];
//                     } else {
//                         T[i][j][k] = T[i-1][j][k];
//                     }
//            	}
//            }
//        }
//    }
//	static <K,V extends Comparable<? super V>>
//	SortedSet<Map.Entry<K,V>> entriesSortedByValues(Map<K,V> map) {
//	    SortedSet<Map.Entry<K,V>> sortedEntries = new TreeSet<Map.Entry<K,V>>(
//	        new Comparator<Map.Entry<K,V>>() {
//	            @Override public int compare(Map.Entry<K,V> e1, Map.Entry<K,V> e2) {
//	                int res = e2.getValue().compareTo(e1.getValue());
//	                return res != 0 ? res : 1;
//	            }
//	        }
//	    );
//	    sortedEntries.addAll(map.entrySet());
//	    return sortedEntries;
//	}
	
 
	 
	//minimum prime factor of all the numbers less than n
    static int minPrime[];
	static void minimumPrime(int n){
		minPrime=new int[n+1];
		minPrime[1]=1;
        for (int i = 2; i * i <= n; ++i) {
            if (minPrime[i] == 0) {         //If i is prime
                for (int j = i * i; j <= n; j += i) {
                    if (minPrime[j] == 0) {
                        minPrime[j] = i;
                    }
                }
            }
        }
        for (int i = 2; i <= n; ++i) {
            if (minPrime[i] == 0) {
                minPrime[i] = i;
            }
        }
	}
	static long power(long base, long exponent, long modulus){
	    long result = 1;
	    while (exponent > 0) {
	        if (exponent % 2 == 1)
	            result = (result * base) % modulus;
	        exponent = exponent >> 1;
	        base = (base * base) % modulus;
	    }
	    return result;
	}
	static long modInverse(long A, long M)
	{
		long x=extendedEuclid(A,M)[0];
		return (x%M+M)%M;    //x may be negative
	}
	static long[] extendedEuclid(long A, long B) {
		if(B == 0) {
			long d = A;
			long x = 1;
			long y = 0;
			return new long[]{x,y,d};
		}
		else {
			long arr[]=extendedEuclid(B, A%B);
			long temp = arr[0];
			arr[0] = arr[1];
			arr[1] = temp - (A/B)*arr[1];
			return arr;
		}
	}
//	static long modpowIter(long a, long b) {
//        long ans=1;
//        while(b != 0) {
//                if(b%2==1)
//                	ans=(ans*a)%mod;
//                a=(a*a)%mod;
//                b=b>>1;
//        }
//        return ans;
//	}
	static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, numChars;
        private SpaceCharFilter filter;
 
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
        
        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }
 
        public String nextLine() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }
 
        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }
 
        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }
 
        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }
 
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
	}
} 