#include<iostream>
#include<algorithm>
using namespace std;
#define rep(i,s,n) for(int i=s;i<n;i++)
#define lol(i,n) for(int i=0;i<n;i++)
typedef long long ll;
#define N 100010
ll a[N],b[N],h,w,cs[N];
int main(){
    cin>>h>>w;
    lol(i,h)cin>>a[i];
    lol(j,w)cin>>b[j];
    sort(a,a+h); sort(b,b+w);
    cs[0]=0; lol(i,w)cs[i+1]=cs[i]+b[i];
    ll ans=0;
    lol(i,h){
	ll t=lower_bound(b,b+w,a[i])-b;
	ans+=cs[t]+a[i]*(w-t);
    }
    cout<<ans<<endl;
    return 0;
}
