#include <bits/stdc++.h>
const int MAXN = 0;
const int MAXM = 0;
const int INF = 2000000000;
const int MOD = 1000000007;
using namespace std;
int a[7];
int main() {
  for (int i = 1; i <= 6; i++) scanf("%d", &a[i]);
  int ans = 0;
  int now = a[1];
  for (int i = 0; i <= a[2] + a[3]; i++) {
    if (i == 0) {
      ans = ans + now;
    }
    if (i == a[2] + a[3]) {
      ans = ans + now;
    }
    if (i != 0 && i != a[2] + a[3]) {
      ans = ans + now * 2;
    }
    if (i < min(a[2], a[6])) now++;
    if (i >= max(a[2], a[6])) now--;
  }
  printf("%d\n", ans);
  return 0;
}
