#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k = 0, l = 0, a[8];
  for (i = 0; i < 6; i++) cin >> a[i];
  k = a[0] + a[1] + a[2];
  l = a[0] * a[0] + a[2] * a[2] + a[4] * a[4];
  cout << (k * k) - l;
}
