#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
struct p {
  double x, y;
  p(double xx = 0, double yy = 0) {
    x = xx;
    y = yy;
  }
  p operator-(const p& j) { return p(x - j.x, y - j.y); }
} a[6];
const double c60 = cos(acos(-1.0) / 3);
const double s60 = sin(acos(-1.0) / 3);
double X[] = {0, c60, -c60, -1, -c60};
double Y[] = {0, s60, s60, 0, -s60};
double cross(p i, p j) { return i.x * j.y - i.y * j.x; }
double area() {
  double area = 0;
  for (int i = 1; i < 5; i++) {
    area += cross(a[i] - a[0], a[i + 1] - a[0]);
  }
  return area / 2.0;
}
int main() {
  double len;
  for (int i = 0; i < 6; i++) {
    cin >> len;
    if (i == 0) {
      a[i].x = len;
      a[i].y = 0;
    } else if (i == 5) {
      a[i].x = a[i].y = 0;
    } else {
      a[i].x = a[i - 1].x + len * X[i];
      a[i].y = a[i - 1].y + len * Y[i];
    }
  }
  double num = area() / (0.5 * s60);
  printf("%.0lf\n", num);
}
