Devu and his brother love each other a lot. As they are super geeks, they only like to play with arrays. They are given two arrays *a* and *b* by their father. The array *a* is given to Devu and *b* to his brother. 

As Devu is really a naughty kid, he wants the minimum value of his array *a* should be at least as much as the maximum value of his brother's array *b*. 

Now you have to help Devu in achieving this condition. You can perform multiple operations on the arrays. In a single operation, you are allowed to decrease or increase any element of any of the arrays by 1. Note that you are allowed to apply the operation on any index of the array multiple times.

You need to find minimum number of operations required to satisfy Devu's condition so that the brothers can play peacefully without fighting.
The first line contains two space-separated integers *n*, *m* (1 ≤ *n*, *m* ≤ 10<sup class="upper-index">5</sup>). The second line will contain *n* space-separated integers representing content of the array *a* (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>). The third line will contain *m* space-separated integers representing content of the array *b* (1 ≤ *b*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>).
#!/usr/bin/env python
import os
import sys

from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter, OrderedDict
from heapq import heapify, heappop, heappush
from io import BytesIO, IOBase
from itertools import product, permutations, combinations, combinations_with_replacement, accumulate, compress
from math import gcd, floor, sqrt, log, pi, factorial, ceil, inf
from string import ascii_lowercase, ascii_uppercase


# sys.setrecursionlimit(10 ** 4)


def cost(a, b, target):
    res = 0
    for v in a:
        res += max(0, target - v)

    for v in b:
        res += max(0, v - target)

    return res


def main():
    input()
    a = li()
    b = li()

    if min(a) >= max(b):
        print(0)
        exit()

    l, r = 1, 10 ** 9

    while l < r:
        mid1 = l + (r - l) // 3
        mid2 = r - (r - l) // 3

        cost1 = cost(a, b, mid1)
        cost2 = cost(a, b, mid2)

        if cost1 == cost2:
            l = mid1 + 1
            r = mid2 - 1
        elif cost1 < cost2:
            r = mid2 if r != mid2 else mid2 - 1
        else:
            l = mid1 if l != mid1 else mid1 + 1

    print(cost(a, b, l))


class FastIO(IOBase):
    def __init__(self, file):
        self.newlines = 0
        self._file = file
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
        self.BUFSIZE = 8192

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, self.BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, self.BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)


def input():
    return sys.stdin.readline().rstrip("\r\n")


def mp():
    return map(int, input().split())


def li():
    return list(map(int, input().split()))


def intput():
    return int(input())


if __name__ == "__main__":
    main()
