#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a) ;i < (b) ;i++)
#define repr(i, a, b) for (int i = (b) - 1 ;i >= a ;i--) 
int main(){
	int w, h, p[100000], q[100000] ;
	cin >> w >> h ;
	rep(i, 0, w)cin>>p[i] ;
	rep(j, 0, h)cin>>q[j] ;

	long ans = 0, added = 0 ;
  	sort(q,q+h,less<int>());
  	sort(p,p+w,less<int>());

  	int i = 0 ,j = 0 ;
  	
  	while(!(i >= w) || !(j >= h)){
  		if ((i < w && p[i] <= q[j]) || j >= h){
  			ans += (h + 1 - j) * long (p[i]) ;
  			i++ ;
  		}else{
  			ans += (w + 1 - i) * long (q[j]) ;
  			j++ ;
  		}

  	}

	cout<<ans<<endl ;
	return 0 ;
}
