#include <bits/stdc++.h>
using namespace std;
long long n, m, a[100010], b[100010];
long long ok(long long x) {
  long long ans = 0;
  for (int i = 0; i < n; i++)
    if (a[i] < x) ans += (x - a[i]);
  for (int i = 0; i < m; i++)
    if (b[i] > x) ans += (b[i] - x);
  return ans;
}
int main() {
  while (~scanf("%I64d%I64d", &n, &m)) {
    long long mi = 1000000000, mm = 0;
    for (int i = 0; i < n; i++) {
      scanf("%I64d", &a[i]);
      mi = ((mi) > (a[i]) ? (a[i]) : (mi));
    }
    for (int i = 0; i < m; i++) {
      scanf("%I64d", &b[i]);
      mm = ((mm) > (b[i]) ? (mm) : (b[i]));
    }
    if (mi >= mm) {
      printf("0\n");
      continue;
    }
    long long l = mi, r = mm;
    long long sum = ((ok(mi)) > (ok(mm)) ? (ok(mm)) : (ok(mi)));
    while (l < r) {
      long long mid = (l + r) / 2;
      long long midd = (r + mid) / 2;
      long long tmp1 = ok(mid), tmp2 = ok(midd);
      if (tmp1 > tmp2) {
        l = mid;
      } else
        r = midd;
      sum = ((sum) > (((tmp1) > (tmp2) ? (tmp2) : (tmp1)))
                 ? (((tmp1) > (tmp2) ? (tmp2) : (tmp1)))
                 : (sum));
    }
    printf("%I64d\n", sum);
  }
  return 0;
}
