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.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.StringTokenizer;
import java.util.stream.Collectors;

public class Main {

    FastScanner scanner = new FastScanner();

    private void calc() {
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int[] a = rarr(n);
        int[] b = rarr(n);
        
        int[] d = new int[n];
        Integer[] index = new Integer[n];
        for (int i = 0; i < n; i++) {
            index[i] = i;
            d[i] = b[i] - a[i];
        }
        
        Arrays.sort(index, (x, y) -> d[y]-d[x]);
//        sout(d);
//        sout(Arrays.toString(index));
        
        int result = 0;
        for (int i = 0; i < k; i++) {
            result += a[index[i]];
        }
        int i = k;
        while (i < n && d[index[i]] > 0) {
            result += a[index[i]];
            i++;
        }
        for (; i < n; i++) {
            result += b[index[i]];
        }
        
        sout(result);
    }

    /*
     * Main Method
     */
    public static void main(String[] args) throws Exception {
//        try (PrintWriter out = new PrintWriter(Files.newBufferedWriter(Paths.get("input.txt")))) {
//            out.println(100000 + " " + 1);
//            for (int i = 0; i < 100000; i++) {
//                out.println(i+1);
//            }
//            out.println(1);
//            out.println("1 100000");
//        }
//        long s = System.currentTimeMillis();
        new Main().calc();
//        long e = System.currentTimeMillis();
//        System.out.println("Total: " + (e - s) + "ms");
    }
    
    /*
using namespace std;

int n, m;
vector < vector < int > > v, ptr;
vector < int > mn;

int main()
{
    scanf("%d%d", &n, &m);
    v.resize(n);
    ptr.resize(n);
    mn.resize(n);
    for (int i = 0; i < n; i++)
    {
        v[i].resize(m);
        ptr[i].resize(m);
    }
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
            scanf("%d", &v[i][j]);
    for (int i = 0; i < n; i++)
    {
        mn[i] = i;
        for (int j = 0; j < m; j++)
        {
            ptr[i][j] = i;
            if (i > 0 && v[i][j] >= v[i - 1][j])
                ptr[i][j] = ptr[i - 1][j];
            mn[i] = min(mn[i], ptr[i][j]);
        }
    }
    int k;
    scanf("%d", &k);
    for (int i = 1; i <= k; i++)
    {
        int l, r;
        scanf("%d%d", &l, &r);
        l--, r--;
        if (mn[r] <= l)
            printf("Yes\n");
        else
            printf("No\n");
    }

    return 0;
}
     */
    
    boolean[] fillSieve(int n) {
        boolean[] primes=new boolean[n+1];
        Arrays.fill(primes,true);
        primes[0]=primes[1]=false;
        for (int i=2;i<primes.length;i++) {
            if(primes[i]) {
                for (int j=2;i*j<primes.length;j++) {
                    primes[i*j]=false;
                }
            }
        }
        return primes;
    }

    /*
     * Read input
     */
    int[] rarr(int count) {
        int[] value = new int[count];
        for (int i = 0; i < count; i++) {
            value[i] = scanner.nextInt();
        }
        return value;
    }

    private static final Charset ANSII = Charset.forName("ASCII");

    int[] rstr() {
        String str = scanner.next().trim();
        ByteBuffer buf = ANSII.encode(str);
        byte[] barr = buf.array();
        int[] result = new int[barr.length];
        for (int i = 0; i < barr.length; i++) {
            result[i] = barr[i];
        }
        return result;
    }

    /*
     * Print Methods
     */
    void sout(int n) {
        sout(Integer.valueOf(n));
    }

    void sout(Collection<?> col) {
        for (Object object : col) {
            sout(object);
        }
    }

    void sout(int[] arr) {
        sout(Arrays.stream(arr).mapToObj(i -> "" + i).collect(Collectors.joining(" ")));
    }

    void sout(Object obj) {
        System.out.println(Objects.toString(obj, ""));
    }

    String toString(int[] arr) {
        byte[] buf = new byte[arr.length];
        for (int i = 0; i < arr.length; i++) {
            buf[i] = (byte) arr[i];
        }
        CharBuffer charBuffer = ANSII.decode(ByteBuffer.wrap(buf));
        return new String(charBuffer.array());
    }

    void soutAsString(int[] arr) {
        sout(toString(arr));
    }

    /*
     * Algorithms
     */
    void sort(int[] data) {
        Arrays.sort(data);
    }

    int max(int[] data) {
        return Arrays.stream(data).max().orElse(Integer.MIN_VALUE);
    }

    int min(int[] data) {
        return Arrays.stream(data).min().orElse(Integer.MIN_VALUE);
    }
    
    int min(int a, int b) {
        return Math.min(a, b);
    }

    int max(int a, int b) {
        return Math.max(a, b);
    }
    
    int maxIndex(int[] data) {
        int index = 0;
        int m = data[0];
        for (int i = 1; i < data.length; i++) {
            if (m < data[i]) {
                m = data[i];
                index = i;
            }
        }
        return index;
    }

    int power(int a, int b) {
        int res = 1;
        int tmp = a;
        while (b > 0) {
            if ((b & 1) == 1) {
                res *= tmp;
            }
            tmp *= tmp;
            b = b >> 1;
        }
        return res;
    }

    int power(int a, long b, int m) {
        int res = 1;
        int tmp = a;
        while (b > 0) {
            if ((b & 1) == 1) {
                res *= tmp;
                res %= m;
            }
            tmp *= tmp;
            tmp %= m;
            b = b >> 1;
        }
        return res;
    }

    int[] fperiod(int m) {
        int matches = 0;
        List<Integer> f = new ArrayList<>();
        f.add(0);
        f.add(1);
        while (true) {
            int n = f.size();
            if (n % 2 == 0 && matches == n / 2) {
                int[] ans = new int[n / 2];
                for (int i = 0; i < ans.length; i++) {
                    ans[i] = f.get(i);
                }
                return ans;
            }
            int c = (f.get(n - 1) + f.get(n - 2)) % m;
            f.add(c);
            if (f.get(matches).equals(c)) {
                matches++;
            } else {
                matches = (f.get(0).equals(c)) ? 1 : 0;
            }
        }
    }

    int[] factorize(int a) {
        // Шаг 1. Начальная установка. Присвоить t=0,k=0,n=N 
        //        (В ходе выполнения алгоритма переменные t,k,n подчинены следующим условиям: 
        //        n=N/p_{1}...p_{t} и n не имеет простых множителей, меньших d_{k}
        List<Integer> p = new ArrayList<>();
        int n = a;
        int d = 2;

        // Шаг 2. Если n=1, алгоритм заканчивается.
        while (n > 1) {
            // Шаг 3. Разделить. Присвоить q=\lfloor n/d_{k}\rfloor ,r=n\mod d_{k}.
            //        (Здесь q  и r соответственно частное и остаток от деления числа n на d_{k}.)
            int q = n / d;
            int r = n % d;

            // Шаг 4. Остаток равен нулю? Если r neq 0, то перейти к шагу 6.
            if (r == 0) {
                // Шаг 5. Множитель найден. Увеличить t на 1 и присвоить p_{t}=d_{k},n=q. 
                //        Возвратиться к шагу 2.
                p.add(d);
                n = q;
            } else {
                // Шаг 6. Частное мало? Если q>d_{k}, увеличить k на 1 и возвратиться к шагу 3.
                if (q > d) {
                    d += ((d & 1) == 0) ? 1 : 2;
                } else {
                    // Шаг 7. n — простое число. Увеличить t на 1, присвоить p_{t}=n 
                    //        и завершить выполнение алгоритма.
                    p.add(n);
                    break;
                }
            }
        }
        return toArray(p);
    }

    int[] toArray(List<Integer> lst) {
        int[] ans = new int[lst.size()];
        for (int i = 0; i < ans.length; i++) {
            ans[i] = lst.get(i);
        }
        return ans;
    }

    class Euclid {
        final int x, y, d;

        public Euclid(int x, int y, int d) {
            this.x = x;
            this.y = y;
            this.d = d;
        }

        @Override
        public String toString() {
            return "Euclid [x=" + x + ", y=" + y + ", d=" + d + "]";
        }
    }

    Euclid extendedEuclid(int a, int b) {
        int x, y;
        int q, r, x1, x2, y1, y2;

        if (b == 0) {
            return new Euclid(1, 0, a);
        }

        x2 = 1;
        x1 = 0;
        y2 = 0;
        y1 = 1;

        while (b > 0) {
            q = a / b;
            r = a - q * b;
            x = x2 - q * x1;
            y = y2 - q * y1;
            a = b;
            b = r;
            x2 = x1;
            x1 = x;
            y2 = y1;
            y1 = y;
        }

        return new Euclid(x2, y2, a);
    }
}

class FastScanner {
    BufferedReader br;
    StringTokenizer st;

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

    String next() {
        while (st == null || !st.hasMoreTokens()) {
            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());
    }
}