#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[7];
  for (int i = 1; i <= 6; i++) cin >> a[i];
  int L = a[5] + a[4] + a[3];
  cout << L * L - a[1] * a[1] - a[3] * a[3] - a[5] * a[5] << "\n";
  return 0;
}
