#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <map>
 
using namespace std;
typedef long long ll;

int main(){
	int w, h;
	ll cost = 0;
	cin >> w >> h;	
	vector<pair<ll, ll> > p(w+h);
	for(int i = 0; i < w; i++){
		cin >> p[i].first;
		p[i].second = 0;
	}
	for(int i = w; i < w+h; i++){
		cin >> p[i].first;
		p[i].second = 1;
	}
	sort(p.begin(), p.end());
	int a = w+1;
	int b = h+1;
	for(int i = 0; i < w+h; i++){
		if(p[i].second == 0){
			a--;
			cost += b*p[i].first;
		}else{	
			b--;
			cost += a*p[i].first;
		}
	}
	cout << cost << endl;
	
	return 0;
}