#include <bits/stdc++.h>
using namespace std;
int n = 6, a[6];
long long ans;
int run() {
  int maxLen = 0;
  for (int i = 0; i < n; i++) {
  }
}
int main() {
  vector<long long> a(6);
  for (long long &i : a) {
    cin >> i;
  }
  ans += (a[0] + a[1] + a[2]) * (a[0] + a[1] + a[2]);
  ans -= a[0] * a[0];
  ans -= a[2] * a[2];
  ans -= a[4] * a[4];
  cout << ans;
}
