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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.util.*;


 public class Solution {



	/*public static int ispr(int n)
    	{
    	//boolean[] isPrime = new boolean[n+1];
        for (int i = 2; i <= n; i++) {
            Prime[i] = true;
        }

        // mark non-primes <= n using Sieve of Eratosthenes
        for (int factor = 2; factor*factor <= n; factor++) {

            // if factor is prime, then mark multiples of factor as nonprime
            // suffices to consider mutiples factor, factor+1, ...,  n/factor
            if (Prime[factor]) {
                for (int j = factor; factor*j <= n; j++) {
                    Prime[factor*j] = false;
                }
            }	
        }	
        // count primes

        /*int primes = 0;
        for (int i = 2; i <= n; i++) {
            if (isPrime	[i])System.out.println(i);


        }*/
	// System.out.println("The number of primes <= " + n + " is " + primes);
	//return 0;
	// if(isPrime[n]==true)return 1; else return 0;

	//}







	public static long fact(long x)
	{
		if(x==0)return 1;
		else return x*fact(x-1);
	}


	public static long exp(long x, long n, long M)
	{

		if(n==0) return 1;

		else if(n%2==0) return exp((x*x)%M,n/2,M);
		else return (x*exp((x*x)%M,(n-1)/2,M))%M;

	}

	//fi

	static long fib(long n)
	{
		long F[][] = new long[][]{{1,1},{1,0}};
		if (n == 0)
			return 0;
		power(F, n-1);

		return F[0][0];
	}

	static void multiply(long F[][], long M[][])
	{
		long x =  F[0][0]*M[0][0] + F[0][1]*M[1][0];
		long y =  F[0][0]*M[0][1] + F[0][1]*M[1][1];
		long z =  F[1][0]*M[0][0] + F[1][1]*M[1][0];
		long w =  F[1][0]*M[0][1] + F[1][1]*M[1][1];

		F[0][0] = x;
		F[0][1] = y;
		F[1][0] = z;
		F[1][1] = w;
	}

	/* Optimized version of power() in method 4 */
	static void power(long F[][], long n)				
	{
		if( n == 0 || n == 1)
			return;
		long M[][] = new long[][]{{1,1},{1,0}};

		power(F, n/2);
		multiply(F, F);

		if (n%2 != 0)
			multiply(F, M);
	}


	static class Point
	{
		long x,y;

		public Point(long a, long b)
		{
			x=a;
			y=b;
		}




	}


	
	
	
	

	static class compy implements Comparator<Point>
	{
		public int compare(Point a, Point b)
		{

			if(a.y>b.y)return 1;
			if(a.y<b.y) return -1;
			if(a.x>b.x) return 1;
			if(a.x<b.x) return -1;		
			return 0;
		}
	}


	static class compx implements Comparator<Point>
	{
		public int compare(Point a, Point b)
		{

			if(a.x>b.x)return 1;
			if(a.x<b.x) return -1;
			if(a.y>b.y) return 1;
			if(a.y<b.y) return -1;		
			return 0;
		}
	}


	public static int gcd(int a, int b)
	{
		if(b==0)
			return a;
		else return gcd(b,a%b);
	}

	static  class MyScanner {

		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine(){
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

	}

	static MyScanner sc = new  MyScanner();
	static PrintWriter pw = new PrintWriter(System.out, true);
	
	static class Node
	{
		int id,wt;
		
		public Node(int x, int y)
		{
			id=x; wt=y;
		}
		
	}
	
	
	static class Distance
	{
		int id;
		long dist;
		
		public Distance(long x, int y)
		{
			dist=x; id=y;
			
		}
	}

	static int factor(int x)
	{
		if(x%2==1)return x;
		
		else
			return factor(x/2);
		
	}
	
	static void printPath(int parent[], int j)
	{
	    // Base Case : If j is source
	    if (parent[j]==-1)
	        {pw.print(j+" ");return;}

	    printPath(parent, parent[j]);

	    pw.print(j+" ");
	}
	
	static void spiralPrint(int m, int n, int[][] a)
	{
	    int i, k = 0, l = 0;
	 
	    /*  k - starting row index
	        m - ending row index
	        l - starting column index
	        n - ending column index
	        i - iterator
	    */
	 
	    while (k < m && l < n)
	    {
	        /* Print the first row from the remaining rows */
	        for (i = l; i < n; ++i)
	        {
	            pw.print(a[k][i]+" ");
	        }
	        k++;
	 
	        /* Print the last column from the remaining columns */
	        for (i = k; i < m; ++i)
	        {
	             pw.print(a[i][n-1]+" ");
	        }
	        n--;
	 
	        /* Print the last row from the remaining rows */
	        if ( k < m)
	        {
	            for (i = n-1; i >= l; --i)
	            {
	                 pw.print(a[m-1][i]+" ");
	            }
	            m--;
	        }
	 
	        /* Print the first column from the remaining columns */
	        if (l < n)
	        {
	            for (i = m-1; i >= k; --i)
	            {
	                pw.print(a[i][l]+" ");
	            }
	            l++;    
	        }        
	    }
	}
	
	//Main begins here :)
	
	public static int exp(Price p)
	{
		if(p.bf<p.af)
		{
			return 1;
		}
		else return 0;
	}
	
	
	
	static class Price
	{
		int bf;
		int af;
		int diff;
		 
		public Price(int x, int y, int d)
		{
			bf=x; af=y; diff=d;
		}
		
	}
	static class expcomp implements Comparator<Price>
	{

		@Override
		public int compare(Price o1, Price o2) {
		
			if(o1.af>o2.af)return -1;
			else if(o1.af==o2.af)
			{
				if(o1.bf<o2.bf)return 1;
				else return -1;
			}
			else
				return 1;
		
		}
		
		
		
	}
	static class chcomp implements Comparator<Price>
	{

		@Override
		public int compare(Price o1, Price o2) {
		
			if(o1.diff>o2.diff)
				return 1;
			if(o1.diff<o2.diff)
				return -1;
			return 0;
		
		}
		
		
		
	}

	
	public static void main(String[] args) {

	
		
		int n = sc.nextInt();
		int k = sc.nextInt();
		
		int ai[] = new int[n];
		int bi[] = new int[n];
		int diff[] = new int[n];
		Price[] items = new Price[n];
		for(int i=0;i<n;i++)ai[i]=sc.nextInt();
		
		for(int i=0;i<n;i++)bi[i]=sc.nextInt();
		
		for(int i=0;i<n;i++)
		{
			
			diff[i]=ai[i]-bi[i];
			Price p = new Price(ai[i],bi[i],diff[i]);
			items[i]=p;
		}
		
		
		Arrays.sort(items, new chcomp());
		
		/*for(int i=0;i<n;i++)
		{
		pw.println(items[i].bf+" "+items[i].af);
		}
		*/
		int early=0;
		int total=0;
		
		for(int i=0;i<n;i++)
		{
			Price p = items[i];
			if(early<k)
			{
				total+=p.bf;
				early++;
			}
			else
			{
				total+=Math.min(p.af, p.bf);
				
			}
			
			
		}
		
		pw.println(total);
		pw.close();
	
	}

} 