#include <bits/stdc++.h>
using namespace std;
const int MN = 100005, inf = 1000000005, MOD = 1000000007;
const long long INF = 1000000000000000005LL;
int t[100];
int suma(int i) {
  int y = min(t[i], t[i + 2]), a = t[i + 1];
  int res = (y + a) * (y + a) - a * a;
  int d = max(t[i], t[i + 2]) - y;
  res += (d * (a + y));
  return res;
}
int main() {
  for (int i = 1; i <= 6; ++i) scanf("%d", &t[i]);
  int ans = suma(1) + suma(4);
  printf("%d", ans);
}
