#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int a[8];
double x[8], y[8];
inline double xj(double x1, double y1, double x2, double y2) {
  return x1 * y2 - x2 * y1;
}
int main() {
  for (int i = 1; i <= 6; ++i) scanf("%d", a + i);
  x[0] = y[0] = 0;
  double dx = 1, dy = 0, tx, ty, ans = 0;
  for (int i = 1; i <= 6; ++i) {
    x[i] = x[i - 1] + dx * a[i];
    y[i] = y[i - 1] + dy * a[i];
    tx = cos(pi / 3) * dx - sin(pi / 3) * dy;
    ty = sin(pi / 3) * dx + cos(pi / 3) * dy;
    dx = tx;
    dy = ty;
  }
  for (int i = 1; i < 6; ++i) ans += xj(x[i], y[i], x[i + 1], y[i + 1]);
  ans = fabs(ans) / 2;
  double sum = ans / (sin(pi / 3) / 2);
  printf("%d\n", (int)sum);
}
