#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, m;
long long a[N], b[N], c[N * 2];
inline long long max(long long a, long long b) { return a > b ? a : b; }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
    c[i] = a[i];
  }
  for (int i = 0; i < m; i++) {
    scanf("%lld", &b[i]);
    c[i + n] = b[i];
  }
  sort(c, c + n + m);
  long long tmp = c[m], ans = 0;
  for (int i = 0; i < n; i++) ans += max(0, tmp - a[i]);
  for (int i = 0; i < m; i++) ans += max(0, b[i] - tmp);
  printf("%lld\n", ans);
  return 0;
}
