#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> friends;
vector<bool> visited;
int trs(int a) { return a * a; }
int main(int argc, const char* argv[]) {
  int t, rt, rb, b, lb, lt;
  cin >> t >> rt >> rb >> b >> lb >> lt;
  long long res = trs(t + rt + rb);
  res -= trs(t) + trs(rb) + trs(lb);
  cout << res << endl;
}
