#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a) for(int i=0;i<(a);i++)
const ll MOD=1000000007;

int main(){
  int W,H;cin>>W>>H;
  vector<pair<int,int> > v(W+H);
  rep(i,W){
    int p; cin>>p;
    v[i]={p,0};
  }
  rep(i,H){
    int p; cin>>p;
    v[i+W]={p,1};
  }
  sort(v.begin(),v.end());
  int a[2]={W+1,H+1};
  ll ans=0;
  rep(i,H+W){
    int x=v[i].second,y=(x+1)%2;
    ans+=1LL*a[y]*v[i].first;
    a[x]=max(0,a[x]-1);
  }
  cout<<ans<<endl;
  return 0;
}
