#include <bits/stdc++.h>
using namespace std;
int a[7];
int main() {
  for (int i = 1; i <= 6; i++) scanf("%d", &a[i]);
  int ans = 0;
  ans += (a[5] + a[3] + a[4]) * (a[5] + a[3] + a[4]);
  ans -= a[1] * a[1] + a[3] * a[3] + a[5] * a[5];
  printf("%d\n", ans);
  return 0;
}
