#include <bits/stdc++.h>
using namespace std;
int main() {
  int R, G, B;
  cin >> R >> G >> B;
  int f[R + 1][G + 1][B + 1], r[R + 1], g[G + 1], b[B + 1];
  for (int i = 1; i <= R; ++i) cin >> r[i];
  for (int i = 1; i <= G; ++i) cin >> g[i];
  for (int i = 1; i <= B; ++i) cin >> b[i];
  memset(f, 0, sizeof(f));
  sort(r + 1, r + R + 1);
  sort(g + 1, g + G + 1);
  sort(b + 1, b + B + 1);
  for (int i = 1; i <= R; ++i) {
    for (int j = 1; j <= G; ++j) f[i][j][0] = f[i - 1][j - 1][0] + r[i] * g[j];
    for (int j = 1; j <= B; ++j) f[i][0][j] = f[i - 1][0][j - 1] + r[i] * b[j];
  }
  for (int i = 1; i <= G; ++i)
    for (int j = 1; j <= B; ++j) f[0][i][j] = f[0][i - 1][j - 1] + g[i] * b[j];
  for (int i = 1; i <= R; ++i)
    for (int j = 1; j <= G; ++j)
      for (int k = 1; k <= B; ++k) {
        int x = f[i - 1][j - 1][k] + r[i] * g[j];
        int y = f[i][j - 1][k - 1] + g[j] * b[k];
        int z = f[i - 1][j][k - 1] + r[i] * b[k];
        f[i][j][k] = max(f[i][j][k], max(x, max(y, z)));
      }
  cout << f[R][G][B] << endl;
  return 0;
}
