#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long a[6];
  for (long long i = 0; i < 6; i++) {
    cin >> a[i];
  }
  long long x = a[0] + a[1] + a[2];
  x *= x;
  cout << x - (a[0] * a[0] + a[2] * a[2] + a[4] * a[4]);
  return 0;
}
