#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;

typedef pair<long long int, int> P;

int main() {
	int w, h;
	cin >> w >> h;
	long long int s[2] = { 0,0 };
	long long int ans = 0;
	vector<P>v(w+h);
	for (int i = 0; i < w; i++) {
		cin >> v[i].first;
		v[i].second = 0;
	}
	for (int i = w; i < w+h; i++) {
		cin >> v[i].first;
		v[i].second = 1;
	}
	sort(v.begin(), v.end());
	for (auto r : v) {
		if (r.second == 0) {
			ans += (h+1 - s[1])*r.first;
			s[0]++;
		}
		else {
			ans += (w+1 - s[0])*r.first;
			s[1]++;
		}
	}
	cout << ans << endl;
}