#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int MAX = 1e5 + 5;
const long long MAX2 = 11;
const int MOD = 998244353;
const long long INF = 2e18;
const int dr[] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
const int dc[] = {0, 1, 0, -1, 1, -1, 1, -1, 0};
const double pi = acos(-1);
const double EPS = 1e-9;
long long n, m, a[MAX], b[MAX], pa[MAX], push_back[MAX], c[2 * MAX], y[2 * MAX],
    ans, cnt, le, ri, mid, nm, res;
void srt(int le, int ri, long long *x) {
  if (le == ri) return;
  int mid = le + ri >> 1;
  srt(le, mid, x), srt(mid + 1, ri, x);
  int a = le, b = mid + 1, id = le;
  while (a <= mid && b <= ri) {
    if (x[a] < x[b])
      y[id++] = x[a++];
    else
      y[id++] = x[b++];
  }
  while (a <= mid) y[id++] = x[a++];
  while (b <= ri) y[id++] = x[b++];
  for (long long i = le; i <= ri; i++) x[i] = y[i];
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) cin >> a[i], c[i] = a[i];
  for (long long i = 1; i <= m; i++) cin >> b[i], c[i + n] = b[i];
  nm = n + m;
  srt(1, n, a);
  srt(1, m, b);
  srt(1, nm, c);
  for (long long i = 1; i <= n; i++) pa[i] = pa[i - 1] + a[i];
  for (long long i = 1; i <= m; i++) push_back[i] = push_back[i - 1] + b[i];
  ans = 1e18;
  for (long long k = 1; k <= nm; k++) {
    cnt = 0;
    le = 1, ri = n, res = 0;
    while (le <= ri) {
      mid = le + ri >> 1;
      if (a[mid] >= c[k])
        ri = mid - 1;
      else
        le = mid + 1, res = mid;
    }
    if (res) cnt += c[k] * res - pa[res];
    le = 1, ri = m, res = 0;
    while (le <= ri) {
      mid = le + ri >> 1;
      if (b[mid] <= c[k])
        le = mid + 1;
      else
        ri = mid - 1, res = mid;
    }
    if (res) cnt += (push_back[m] - push_back[res - 1]) - c[k] * (m - res + 1);
    ans = min(ans, cnt);
  }
  cout << ans << "\n";
  return 0;
}
