#include <bits/stdc++.h>
using namespace std;
struct P {
  long double x, y;
  P() {
    x = 0.0;
    y = 0.0;
  }
};
int main() {
  long double a[6] = {1, 1, 1, 1, 1, 1};
  P n;
  long double ang = 0;
  long double turn = 60.0 / 180 * 3.14159265359l;
  P points[6];
  for (int i = 0; i < 6; i++) {
    n.x += cos(ang) * a[i];
    n.y += sin(ang) * a[i];
    ang += turn;
    points[i] = n;
  }
  long double total = 0;
  for (int i = 0; i < 6; i++) {
    int s = (i + 1) % 6;
    total += (points[i].y + points[s].y) / 2 * (points[i].x - points[s].x);
  }
  long double std = total / 6.0;
  for (int i = 0; i < 6; i++) {
    cin >> a[i];
  }
  n.x = 0;
  n.y = 0;
  ang = 0;
  turn = 60.0 / 180 * 3.14159265359l;
  for (int i = 0; i < 6; i++) {
    n.x += cos(ang) * a[i];
    n.y += sin(ang) * a[i];
    ang += turn;
    points[i] = n;
  }
  total = 0;
  for (int i = 0; i < 6; i++) {
    int s = (i + 1) % 6;
    total += (points[i].y + points[s].y) / 2 * (points[i].x - points[s].x);
  }
  cout << (int64_t)round(total / std) << endl;
}
