#include <bits/stdc++.h>
using namespace std;
const unsigned long long MOD = 1e9 + 7, Base = 998244353;
const unsigned long long N = 6e5 + 7;
const unsigned long long INF = 2LL * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 +
                               7LL,
                         INF2 = (1LL << 62);
const double pie = acos(-1.0);
const double EPS = 1e-9;
unsigned long long n, test, a[N], b[N], m, Min = INF, sumb, suma;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (unsigned long long i = 1; i <= n; ++i) cin >> a[i];
  for (unsigned long long j = 1; j <= m; ++j) cin >> b[j], sumb += b[j];
  sort(a + 1, a + 1 + n), sort(b + 1, b + 1 + m);
  Min = sumb * n;
  for (unsigned long long i = 0; i < n; ++i) {
    suma += a[i];
    Min = min(Min, suma + sumb * (n - i));
  }
  sumb = 0, suma += a[n];
  for (unsigned long long i = 0; i < m; ++i) {
    sumb += b[i];
    Min = min(Min, sumb + suma * (m - i));
  }
  sumb += b[m];
  Min = min({Min, suma * m, sumb * n});
  cout << Min << '\n';
  return 0;
}
