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