#include <bits/stdc++.h>
using namespace std;
int a[7];
int main() {
  int i, i1, i2, num, nrtr, nrtr1, st, dr;
  long long ans = 0;
  for (i = 1; i <= 6; i++) scanf("%d", &a[i]);
  nrtr1 = a[3];
  st = a[2];
  i1 = 2;
  dr = a[4];
  i2 = 4;
  while (1) {
    st--;
    dr--;
    nrtr = nrtr1;
    num = 0;
    if (i1 % 2 == 0)
      num++;
    else
      num--;
    if (i2 % 2 == 0)
      num++;
    else
      num--;
    if (num == 2) nrtr++;
    if (num == -2) nrtr--;
    ans = (long long)ans + nrtr1 + nrtr;
    if (st == 0) {
      i1--;
      if (i1 <= 0) break;
      st = a[i1];
    }
    if (dr == 0) {
      i2++;
      if (i2 >= 6) break;
      dr = a[i2];
    }
    nrtr1 = nrtr;
  }
  printf("%I64d\n", ans);
  return 0;
}
