#include <bits/stdc++.h>
using namespace std;
bool comp(long long int x, long long int y) { return x > y; }
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int a[n], b[m];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 0; i < m; i++) cin >> b[i];
  sort(a, a + n);
  sort(b, b + m, comp);
  long long int ans = 0;
  for (long long int i = 0; i < min(n, m); i++) {
    if (b[i] > a[i])
      ans += abs(a[i] - b[i]);
    else
      break;
  }
  cout << ans;
}
