#include <bits/stdc++.h>
using namespace std;
const long long inf = 2000000000;
int n, m;
long long a[100005], b[100005];
long long Min, Max;
long long min(long long a, long long b) { return (a < b ? a : b); }
long long cal(long long value) {
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    if (value > a[i]) sum += value - a[i];
  }
  for (int i = 0; i < m; ++i) {
    if (value < b[i]) sum += b[i] - value;
  }
  return sum;
}
long long ternary() {
  long long left, right;
  long long mid, mmid;
  left = Min, right = Max;
  long long ans = min(cal(left), cal(right));
  while (left < right) {
    mid = left + (right - left) / 3;
    mmid = right - (right - left) / 3;
    long long tmp1 = cal(mid);
    long long tmp2 = cal(mmid);
    if (tmp1 <= tmp2) {
      ans = min(ans, tmp1);
      right = mmid - 1;
    } else {
      ans = min(ans, tmp2);
      left = mid + 1;
    }
  }
  return ans;
}
void init() {
  memset(a, 0, sizeof a);
  memset(b, 0, sizeof b);
  Min = inf;
  Max = -1;
}
int main() {
  while (~scanf("%d %d", &n, &m)) {
    init();
    for (int i = 0; i < n; ++i) {
      scanf("%lld", &a[i]);
      if (Min > a[i]) {
        Min = a[i];
      }
    }
    for (int i = 0; i < m; ++i) {
      scanf("%lld", &b[i]);
      if (Max < b[i]) {
        Max = b[i];
      }
    }
    if (Min >= Max) {
      printf("%d\n", 0);
    } else {
      printf("%lld\n", ternary());
    }
  }
}
