#include <bits/stdc++.h>
using namespace std;
int n, m;
long long a[100100], b[100100], ans;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(a, a + n);
  sort(b, b + m, greater<long long>());
  n = min(n, m);
  for (int i = 0; i < n and a[i] < b[i]; i++) {
    ans += b[i] - a[i];
  }
  cout << ans << endl;
  ;
  return 0;
}
