#include <bits/stdc++.h>
#pragma GCC optimize "O3"
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int N = 1e5 + 5;
int n, m;
long long a[N], b[N];
void solve() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) cin >> b[i];
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  for (int i = 1; i <= n; i++) a[i] += a[i - 1];
  for (int i = 1; i <= m; i++) b[i] += b[i - 1];
  long long ans = INF;
  for (int i = 1; i <= n; i++)
    if ((INF - a[n - i]) / i >= b[m]) ans = min(ans, a[n - i] + b[m] * i);
  for (int i = 1; i <= m; i++)
    if ((INF - b[m - i]) / i >= a[n]) ans = min(ans, b[m - i] + a[n] * i);
  cout << ans << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
