#include <bits/stdc++.h>

using namespace std;

int const N = 1234567;

int a[N], b[N];

int main() {
  int w, h;
  scanf("%d%d", &w, &h);
  for (int i = 0; i < w; i++) scanf("%d", a + i);
  for (int i = 0; i < h; i++) scanf("%d", b + i);
  std::sort(a, a + w);
  std::sort(b, b + h);
  int cur1 = 0;
  int cur2 = 0;
  long long ans = 0;
  while (cur1 < w || cur2 < h) {
    if (cur2 >= h || (cur1 < w && a[cur1] < b[cur2])) {
      ans += (long long) a[cur1++] * (h - cur2 + 1);
    } else {
      ans += (long long) b[cur2++] * (w - cur1 + 1);
    }
  }
  printf("%lld\n", ans);
}