#include <bits/stdc++.h>
using namespace std;
int ans, a[7];
int numTrianglesInTrapezium(int x, int y, int l) {
  int sum = 0;
  if (x > y) swap(x, y);
  for (int i = x; i < y; i++) sum += 2 * i + 1;
  return sum;
}
int numTrianglesInParellogram(int x, int l) { return 2 * x * l; }
int main() {
  for (int i = 1; i <= 6; i++) cin >> a[i];
  if (a[2] < a[6]) swap(a[2], a[6]), swap(a[3], a[5]);
  ans += numTrianglesInTrapezium(a[1], a[1] + a[6], a[6]);
  ans += numTrianglesInParellogram(a[1] + a[6], a[2] - a[6]);
  ans += numTrianglesInTrapezium(a[4], a[1] + a[6], a[5] - (a[2] - a[6]));
  cout << ans;
  return 0;
}
