#include <bits/stdc++.h>
#define forn(i, n) for (int i = 0; i < n; ++i)
#define for1(i, n) for (int i = 1; i <= n; ++i)
#define fore(i, l, r) for (int i = l; i <= r; ++i)

using namespace std;
using LL = long long;

const int MOD = 1'000'000'007;
vector<int> vert;
vector<int> horiz;



int main(){
	int n, m; cin >> n >> m;
	vert.resize(n);
	horiz.resize(m);
	forn(i, n){
		cin >> vert[i];
	}
	forn(i, m){
		cin >> horiz[i];
	}
	sort (vert.begin(), vert.end());
	sort (horiz.begin(), horiz.end());
	reverse(horiz.begin(), horiz.end());
	LL area = 0;
	
	for1(i, n - 1){
		for1(j, m - 1){
		}
	}
	cout << area << endl;
	
	return 0;
}