#include <bits/stdc++.h>
using namespace std;
int main() {
  int x1, x2, x3, x4, x5, x6;
  cin >> x1 >> x2 >> x3 >> x4 >> x5 >> x6;
  cout << (x2 < x6 ? x2 : x6) * ((x2 < x6 ? x2 : x6) + 2 * x1) +
              (x3 < x5 ? x3 : x5) * ((x3 < x5 ? x3 : x5) + 2 * x4) +
              (x2 < x6 ? x6 - x2 : x2 - x6) *
                  ((2 * ((x2 < x6 ? x2 : x6) - 1) + 2 * x1 + 1) + 1);
  return 0;
}
