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