#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  int w,h;
  cin >> w >> h;
  unsigned long long int p[w+1];
  unsigned long long int q[h+1];
  for(int i=0;i<w;i++)
    cin >> p[i];
  for(int j=0;j<h;j++)
    cin >> q[j];
  p[w] = 200000001;
  q[h] = 200000001;
  sort(p,p+w);
  sort(q,q+h);
  unsigned long long int count = 0;
  int i=0;
  int j=0;
  unsigned long long int kw = w+1;
  unsigned long long int kh = h+1;
  while(i!=w||j!=h){
    if(p[i]<q[j]){
      count += p[i]*kh;
      kw--;
      i++;
    }
    else{
      count += q[j]*kw;
      kh--;
      j++;
    }
  }
  cout << count << endl;
  return 0;
}
  
