#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, test, a, b, c, d, e, f, l1, l2, h1;
  scanf("%d %d %d", &a, &b, &c);
  scanf("%d %d %d", &d, &e, &f);
  long long ans1 = 3, m = 1;
  if (b < f) {
    l1 = b;
    h1 = f;
  } else {
    l1 = f;
    h1 = b;
  }
  for (int i = 2; i <= a; i++) {
    ans1 += 2;
  }
  long long n1 = ans1;
  for (int i = 2; i <= h1; i++) {
    n1 += 2;
    ans1 += n1;
    if (i > l1) {
      ans1 -= m;
      m += 2;
    }
  }
  long long ans2 = 3;
  for (int i = 2; i <= d; i++) {
    ans2 += 2;
  }
  long long n2 = ans2;
  if (c < e) {
    l2 = c;
  } else {
    l2 = e;
  }
  for (int i = 2; i <= l2; i++) {
    n2 += 2;
    ans2 += n2;
  }
  long long ans = ans1 + ans2;
  printf("%I64d\n", ans);
  return 0;
}
