#include <bits/stdc++.h>
using namespace std;
int n, m, a[100100], b[100100];
long long ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < m; i++) scanf("%d", &b[i]);
  sort(a, a + n);
  sort(b, b + m, greater<int>());
  n = min(n, m);
  for (int i = 0; i < n and a[i] < b[i]; i++) {
    ans += b[i] - a[i];
  }
  printf("%I64d\n", ans);
  return 0;
}
