#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for(int i = x; i < n; ++i)

pair<int, bool> r[200000];

int main() {
	int w, h;
	scanf("%d%d", &w, &h);
	int s = w + h;
	f(i, 0, w)scanf("%d", &r[i].first);
	f(i, 0, h)scanf("%d", &r[i + w].first), r[i + w].second = true;
	sort(r, r + s);
	++w, ++h;
	ll an = 0;
	f(i, 0, s) {
		if (r[i].second)an += (ll)r[i].first * w, --h;
		else an += (ll)r[i].first * h, --w;
	}
	printf("%lld\n", an);
}