#include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
int a[10];
int main() {
  for (int i = 0; i < 6; i++) scanf("%d", &a[i]);
  int now = a[1], nxt = a[1] + 1;
  int ans = 0;
  int l = 0, r = 1;
  if (a[0] > a[2]) swap(a[0], a[2]), swap(a[3], a[5]);
  for (int i = 0; i < a[0]; i++) {
    ans += now * 2 + 1;
    now++;
  }
  for (int i = a[0]; i < a[2]; i++) {
    ans += now * 2;
  }
  for (int i = a[2]; i < a[0] + a[5]; i++) {
    ans += now * 2 - 1;
    now--;
  }
  printf("%d\n", ans);
}
