#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int ans(0);
  const int n = 6;
  vector<int> rt(n);
  for (int i = 0; i < n; ++i) {
    cin >> rt[i];
    if (!(i & 1)) {
      ans += (rt[i] * rt[i]);
    }
  }
  int t = rt[0] + rt[1] + rt[2];
  t *= t;
  cout << t - ans;
}
