#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main(){
  int W, H;
  cin >> W >> H;
  vector<long long> p(W);
  vector<long long> q(H);

  for(int i = 0; i < W; i++) cin >> p[i];
  for(int i = 0; i < H; i++) cin >> q[i];

   sort(p.begin(), p.end());
   sort(q.begin(), q.end());

   int w = W + 1, h = H + 1;
   long long res = 0;
   int i = 0, j = 0;
  while(i < W || j < H){
    if(j < H && (i == W || p[i] > q[j])){
      res += q[j]*w;
      --h;
      ++j;
    }
    else{
      res += p[i] * h;
      --w;
      ++i;
    }
  }
  cout << res << endl;
  return 0;
}