#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
void output(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x == 0) {
    putchar('0');
    return;
  }
  int a[20], num = 0;
  while (x) a[++num] = x % 10, x /= 10;
  while (num > 0) putchar('0' + a[num--]);
}
inline long long myInt() {
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  int flag = 1;
  if (c == '-') flag = -1, c = getchar();
  long long x = 0;
  while (isdigit(c)) {
    x = (x * 10) + (c - '0');
    c = getchar();
  }
  if (-1 == flag) return -x;
  return x;
}
const int N = 100005;
struct point {
  double x, y;
  point() {}
  point(double _x, double _y) {
    x = _x;
    y = _y;
  }
  point operator+(point a) { return point(x + a.x, y + a.y); }
  point operator-(point a) { return point(x - a.x, y - a.y); }
  double operator*(point a) { return x * a.y - y * a.x; }
  double operator^(point a) { return x * a.x + y * a.y; }
  point operator*(double t) { return point(x * t, y * t); }
  point operator/(double t) { return point(x / t, y / t); }
  point verlLeft() { return point(-y, x); }
  point verlRight() { return point(y, -x); }
  void read() { scanf("%lf %lf", &x, &y); }
};
int sgn(double x) {
  if (x > 1e-8) return 1;
  if (x < -1e-8) return -1;
  return 0;
}
double dist(point a, point b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
int same(point a, point b) {
  return sgn(a.x - b.x) == 0 && sgn(a.y - b.y) == 0;
}
double pointDistLine(point a, point p, point q) {
  return fabs((p - a) * (q - a)) / dist(p, q);
}
point normal(point d) {
  double L = sqrt(d.x * d.x + d.y * d.y);
  return point(d.x / L, d.y / L);
}
point walk(point a, point dir, double L) {
  dir = normal(dir);
  return a + (dir * L);
}
double cross(point a, point b, point p) { return (b - a) * (p - a); }
int isOnLine(point s, point e, point p) { return sgn((e - s) * (p - s)) == 0; }
int isOnSeg(point s, point e, point p) {
  if (!isOnLine(s, e, p)) return 0;
  return sgn((p.x - s.x) * (p.x - e.x)) <= 0 &&
         sgn((p.y - s.y) * (p.y - e.y)) <= 0;
}
int isCross(point a, point b, point p, point q) {
  return sgn(cross(a, b, p)) * sgn(cross(a, b, q)) <= 0 &&
         sgn(cross(p, q, a)) * sgn(cross(p, q, b)) <= 0;
}
point p[6];
point rot(int t) {
  if (t == 0) return point(1, 0);
  if (t == 1) return point(0.5, sin(acos(-1.0) / 3));
  if (t == 2) return point(-0.5, sin(acos(-1.0) / 3));
  if (t == 3) return point(-1, 0);
  if (t == 4) return point(-0.5, -sin(acos(-1.0) / 3));
  return point(0.5, -sin(acos(-1.0) / 3));
}
int main() {
  point pre = point(0, 0);
  double sum = 0;
  for (int i = 0; i < 6; i++) {
    double x = myInt();
    p[i] = pre + rot(i) * x;
    pre = p[i];
  }
  for (int i = 0; i < 6; i++) {
    sum += p[i] * p[(i + 1) % 6];
  }
  int ans = fabs(sum / sin(acos(-1.0) / 3)) + 0.5;
  printf("%d\n", ans);
}
