#include "iostream"
#include "sstream"
#include "string"
#include "cstring"
#include "cstdio"
#include "cstdlib"
#include "cmath"
#include "algorithm"
#include "utility"
#include "vector"
#include "map"
#include "unordered_map"
#include "set"
#include "bitset"
#include "unordered_set"
#include "list"
#include "deque"
#include "functional"
#include "ctime"
#include "tuple"
#include "memory"
#include "limits"
#include "stack"
#include "forward_list"
#include "iterator"
#include "array"
#include "random"
#include "queue"


using namespace std;

// Functions
vector<string> StrSplit(string work, char delim, int rep);

template <typename T, typename Display> 
void print_vector(const vector<T>& vec, Display disp);

vector<string> StrSplit(string work, char delim, int rep = 0) {
    // rep == 1: Also insert empty strings
    vector<string> flds;
    if (!flds.empty()) flds.clear();  // empty vector if necessary
    string buf = "";
    int i = 0;
    while (i < work.size()) {
        if (work[i] != delim)
            buf += work[i];
        else if (rep == 1) {
            flds.push_back(buf);
            buf = "";
        } else if (!buf.empty()) {
            flds.push_back(buf);
            buf = "";
        }
        i++;
    }
    if (!buf.empty())
        flds.push_back(buf);
    cout << flds.size() << endl;
    return flds;
}

template <typename T, typename Display> 
void print_vector(const vector<T>& vec, Display disp) {
    for (const auto& val:vec) {
        disp(val);
    }
}

class Point {
public:
    typedef int pos_type;
    pos_type x,y;
    explicit Point(pos_type x_in, pos_type y_in):x(x_in), y(y_in) {}
    explicit Point():x(), y() {}
    bool operator < (const Point& other) const {
        if (x != other.x) return x < other.x;
        return y < other.y;
    }
    bool operator == (const Point& other) const {
        return x == other.x && y == other.y;
    }
    void print() {
        // for debug
        cout << "(" << x << "," << y << ")";
    }
};

#define MP make_pair
#define debug false
#define UNM unordered_map
#define UNS unordered_set

typedef vector<int> VI;
typedef vector<VI> Mat;
typedef pair<int,int> PI;

class Node {
public:
    int val;
    int type = 0;
    int index = 0;
    Node(int v, int t, int ind):val(v), type(t), index(ind) {}
    
    bool operator < (const Node& other) const {
        return val > other.val;
    }
    
};
class Solution {
public:
    void solve() {
        int W, H;
        while (cin >> W >> H) {
            vector<int> vecW, vecH;
            int kw = 0;
            int kh = 0;

            priority_queue<Node> que;
            for (int i = 0; i < W; ++i) {
                int tmp;
                scanf("%d", &tmp);
                Node cn(tmp, 0, i);
                que.push(cn);
            }
            for (int i = 0; i < H; ++i) {
                int tmp;
                scanf("%d", &tmp);
                Node cn(tmp, 1, i);
                que.push(cn);
            }
            long long ans = 0;
            while (!que.empty()) {
                Node cur = que.top();
                que.pop();
                
                if (cur.type == 0) {
                    // is W
                    ans += static_cast<long long>(cur.val) * static_cast<long long>(H - kh + 1);
                    kw++;
                }
                else {
                    // is H
                    ans += static_cast<long long>(cur.val) * static_cast<long long>(W - kw + 1);
                    kh++;
                }
            }
            cout << ans << endl;
        }
    }
};


int main() {
    Solution sol;
    sol.solve();
    return 0;
}


Measured memory_bytes: 3444