#include <iostream>
#include <algorithm>
#include <vector>
#define MAX 100010

using namespace std;

int w,h;
vector<pair<int,int> > v;
long long a,b;
long long ans;

int main() {
    cin >> w >> h;
    for (int i = 0; i < w; i++) {
        int p;
        cin >> p;
        v.push_back(make_pair(p,0));
    }
    for (int i = 0; i < h; i++) {
        int p;
        cin >> p;
        v.push_back(make_pair(p,1));
    }

    sort(v.begin(),v.end());

    for (auto p : v) {
        long long c = p.first;
        if (p.second == 0) {
            ans += c * (h+1 - b);
            a++;
        } else {
            ans += c * (w+1 - a);
            b++;
        }
    }

    cout << ans << '\n';
}
