#include <bits/stdc++.h>
using namespace std;
long long sum(vector<int> &x) {
  long long ret = 0;
  for (int i = 0; i < x.size(); i++) ret += x[i];
  return ret;
}
long long solve(vector<int> &a, vector<int> &b) {
  int n = a.size(), m = b.size(), i, j, k;
  long long s1 = sum(a);
  long long s2 = sum(b);
  long long ret = 1e18;
  for (i = n - 1; i >= 0; i--) {
    s1 -= a[i];
    if ((n - i) > (ret - s1) / s2) continue;
    ret = min(ret, s1 + s2 * (n - i));
  }
  return ret;
}
int main() {
  int n, i, j, k, m;
  cin >> n >> m;
  vector<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.begin(), a.end());
  sort(b.begin(), b.end());
  cout << min(solve(a, b), solve(b, a)) << endl;
  return 0;
}
