#include<bits/stdc++.h>

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define EPS (1e-8)
#define equals(a,b) (fabs((a)-(b))<EPS)
#define ALL(x) x.begin(),x.end()

using namespace std;

typedef long long ll;

bool LT(double a,double b) { return !equals(a,b) && a < b; }
bool LTE(double a,double b) { return equals(a,b) || a < b; }

int H,W;
vector<ll> A, B;

struct Data {
  bool type;
  ll len;
  bool operator < ( const Data &data ) const {
    if( len != data.len ) return len < data.len;
    return type < data.type;
  }
};

void compute() {
  vector<Data> vec;
  rep(i,H) vec.push_back((Data){false,A[i]});
  rep(i,W) vec.push_back((Data){true,B[i]});
  sort(ALL(vec));
  ll ans = 0;
  rep(i,(int)vec.size()) {
    if( vec[i].type == false ) { // H
      ans += ( vec[i].len * W );
      --H;
    } else { // W
      ans += ( vec[i].len * H );
      --W;
    }
  }
  cout << ans << endl;
}

int main() {
  cin >> H >> W;
  A.resize(H), B.resize(W);
  rep(i,H) cin >> A[i];
  rep(i,W) cin >> B[i];
  compute();
  return 0;
}

