#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define inf 1000000007
#define int long long

signed main() {
	int h, w;
	cin >> h >> w;
	vector<pair<int, int>> d;
	rep(i, h) {
		int w;
		cin >> w;
		d.push_back(make_pair(w, 0));
	}
	rep(i, w) {
		int w;
		cin >> w;
		d.push_back(make_pair(w, 1));
	}
	sort(d.begin(), d.end(), greater<pair<int, int>>());
	int all = 0;
	int na = 0;
	int nb = 0;
	for(auto i: d) {
		if(i.second == 0) {
			all += nb * i.first;
			na++;
		}
		else {
			all += na * i.first;
			nb++;
		}
	}
	cout << all << endl;
}
