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