#include <bits/stdc++.h>
using namespace std;
int main() {
  int a1, a2, a3, a4, a5, a6;
  cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6;
  int b1 = min(a2, a6), b2 = min(a3, a5);
  int res = ((a1 * 2 + 1) + (a1 * 2 + 1 + (b1 - 1) * 2)) * b1 / 2 +
            (max(a2, a6) - b1) * (a1 * 2 + b1 * 2) +
            ((a4 * 2 + 1) + (a4 * 2 + 1 + (b2 - 1) * 2)) * b2 / 2;
  cout << res << endl;
  return 0;
}
