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