#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long x[n];
  long long y[m];
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  long long sumx = 0;
  long long sumy = 0;
  long long diff = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      diff = x[j] - x[i];
      sumx += diff;
    }
  }
  for (int i = 0; i < m; i++)
    for (int j = i + 1; j < m; j++) {
      diff = y[j] - y[i];
      sumy += diff;
    }
  cout << sumx * sumy;
  return 0;
}
