#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, i, j, k, l1 = 0, l2 = 0, s1 = 0, s2 = 0, s3 = 0;
  cin >> n >> m;
  int a[n], b[m];
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < m; i++) cin >> b[i];
  sort(a, a + n);
  sort(b, b + m, greater<int>());
  for (i = 0; i < min(n, m) && a[i] < b[i]; i++) s1 += abs(b[i] - a[i]);
  cout << s1;
  return 0;
}
