#include <bits/stdc++.h>
using namespace std;
double a[10];
double x[10], y[10], s, s0;
int main() {
  for (int i = 1; i <= 6; i++) cin >> a[i];
  x[1] = y[1] = 0;
  x[2] = a[1];
  x[3] = x[2] + a[2] / 2;
  y[3] = -a[2] / 2 * sqrt(3);
  x[4] = x[3] - a[3] / 2;
  y[4] = y[3] - a[3] / 2 * sqrt(3);
  x[5] = x[4] - a[4];
  y[5] = y[4];
  x[6] = x[5] - a[5] / 2;
  y[6] = y[5] + a[5] / 2 * sqrt(3);
  x[7] = x[1];
  y[7] = y[1];
  for (int i = 1; i <= 6; i++) s += x[i] * y[i + 1] - y[i] * x[i + 1];
  s /= 2;
  if (s < 0) s = -s;
  s0 = sqrt(3) / 4;
  cout << (int)round(s / s0);
  return 0;
}
