#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::sort;
using std::string;
using std::swap;
int main() {
  int times = INT_MAX;
  int a[6];
  while (times-- && ~scanf("%d", &a[0])) {
    for (int i = 1; i < 6; ++i) scanf("%d", a + i);
    printf("%d\n", (a[0] + a[1] + a[2]) * (a[0] + a[1] + a[2]) - a[0] * a[0] -
                       a[2] * a[2] - a[4] * a[4]);
  };
  return 0;
};
