#include <bits/stdc++.h>
int main(void) {
  int a[6];
  for (int i = 0; i < 6; i++) scanf("%d", &a[i]);
  long long tri = a[0];
  int left = true;
  int right = true;
  int left_cnt = 0;
  int right_cnt = 0;
  int triangle = a[0];
  while (true) {
    if ((left_cnt == a[1] + a[2]) || (right_cnt == a[4] + a[5])) break;
    if (left_cnt == a[1]) left = false;
    if (right_cnt == a[5]) right = false;
    if (left && right)
      triangle++;
    else if (!left && !right)
      triangle--;
    tri += triangle * 2;
    left_cnt++;
    right_cnt++;
  }
  printf("%d\n", tri - a[3]);
  return 0;
}
