#include<bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef long long ll; 
typedef pair<int,int> P;
typedef pair<ll,P> lP;
int p[100000],q[100000];
ll w,h;
ll ans;
vector<lP> v;
int main(){
  cin>>w>>h;
  for(int i=0;i<w;i++)cin>>p[i],v.push_back(lP(p[i],P(i,0)));
  for(int i=0;i<h;i++)cin>>q[i],v.push_back(lP(q[i],P(i,1)));
  sort(v.begin(),v.end());
  ll g=(w+1)*(h+1)-1,t=0,y=0;
  for(int i=0;i<v.size();i++){
    if(v[i].s.s==0){
      ll k=h+1-y;
      t++;
      g-=k;
      ans+=k*v[i].f;
    }
    if(v[i].s.s==1){
      ll k=w+1-t;
      y++;
      g-=k; 
      ans+=k*v[i].f;
    }
  }
  cout<<ans<<endl;
  return 0;
}
