#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0);
const long double t = PI / 3.0;
const long double cost = cos(t);
const long double sint = sin(t);
struct Point {
  long double x, y;
  Point() { x = y = 0; }
  Point(long double x, long double y) : x(x), y(y) {}
  Point ort() { return Point(-y, x); }
  Point rot() { return Point(cost * x - sint * y, sint * x + cost * y); }
};
Point operator-(const Point &A, const Point &B) {
  return Point(A.x - B.x, A.y - B.y);
}
Point operator+(const Point &A, const Point &B) {
  return Point(A.x + B.x, A.y + B.y);
}
Point operator*(const Point &A, const long double &k) {
  return Point(A.x * k, A.y * k);
}
long double cross(const Point &A, const Point &B) {
  return A.x * B.y - A.y * B.x;
}
long double area(const Point &A, const Point &B, const Point &C) {
  return cross(B - A, C - A);
}
long double area(vector<Point> &Poly) {
  int nP = Poly.size();
  long double ans = 0;
  for (int i = 0; i < nP; i++)
    ans += area(Point(), Poly[i], Poly[(i + 1) % nP]);
  return abs(ans);
}
long double cte = 1.1547005383792514621177360822912305593491;
int main() {
  int A[6];
  while (cin >> A[0]) {
    for (int i = 0; i < 6; i++) {
      if (!i) continue;
      cin >> A[i];
    }
    vector<Point> vec;
    Point u(cost, sint);
    Point P;
    for (int i = 0; i < 6; i++) {
      P = P + (u * A[i]);
      vec.push_back(P);
      u = u.rot();
    }
    long double S = area(vec);
    cout << (long long)round((S * cte)) << '\n';
  }
}
