#include <bits/stdc++.h>
int main() {
  int a, b, c, d, e, f;
  scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f);
  printf("%d\n", a * a + 2 * a * b + 2 * (a + b) * (c - a) + d * d + 2 * d * e);
  return 0;
}
