#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (T x : p) os << x << " ";
  os << "]" << endl;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const multiset<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const map<Tk, Tv>& p) {
  os << "{ ";
  for (pair<Tk, Tv> x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const pair<Tk, Tv>& p) {
  os << "{" << p.first << ',' << p.second << "}";
  return os;
}
long long gcd(long long a, long long b) { return (a ? gcd(b % a, a) : b); }
long long power(long long a, long long n) {
  long long p = 1;
  while (n > 0) {
    if (n & 1) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
long long power(long long a, long long n, long long mod) {
  long long p = 1;
  while (n > 0) {
    if (n & 1) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
const int N = 100005;
int a[N], b[N];
long long sa[N], sb[N];
set<int> s;
int main() {
  int i, j;
  int n, m;
  scanf("%d", &n), scanf("%d", &m);
  for (i = 1; i < n + 1; i++) scanf("%d", &a[i]), s.insert(a[i]);
  for (i = 1; i < m + 1; i++) scanf("%d", &b[i]), s.insert(b[i]);
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  for (i = 1; i < n + 1; i++) sa[i] = sa[i - 1] + (long long)a[i];
  for (i = m; i >= 1; i--) sb[i] = sb[i + 1] + (long long)b[i];
  long long y = 1e18;
  for (auto x : s) {
    long long noa = lower_bound(a + 1, a + n + 1, x) - a;
    noa--;
    long long nob = upper_bound(b + 1, b + m + 1, x) - b;
    y = min(y, noa * x - sa[noa] + sb[nob] - (m - nob + 1) * x);
  }
  printf("%lld\n", (long long)y);
  return 0;
}
