#include <bits/stdc++.h>
int max(int a, int b) {
  if (a > b) {
    return a;
  } else
    return b;
}
int main() {
  double a, b, c, d, e, f;
  scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f);
  double area;
  area = (2 * a + b) * b + e * (2 * d + e) + (d + e) * 2 * (f - b);
  printf("%d", (int)area);
  return 0;
}
