#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[6];
  for (int i = 0; i < 6; i++) cin >> a[i];
  int curr = a[0];
  int next = curr + 1;
  int step = 1;
  int side1 = a[5], side2 = a[1];
  int ind1 = 5, ind2 = 1;
  int subt = 0;
  int ans = 0;
  while (1) {
    ans += curr + next;
    curr = next;
    int chn;
    if (ind1 == 5 && ind2 == 1)
      chn = 1;
    else if (ind1 - ind2 == 3)
      chn = 0;
    else
      chn = -1;
    if (step == side1) {
      subt++;
      side1 += a[ind1 - 1];
      ind1--;
    }
    if (step == side2) {
      subt++;
      side2 += a[ind2 + 1];
      ind2++;
    }
    next = next + chn - subt;
    subt = 0;
    step++;
    if (ind1 <= ind2) break;
  }
  cout << ans;
  return 0;
}
