#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int a[6];
  for (int i = 0; i < 6; ++i) cin >> a[i];
  int s = a[0] + a[1] + a[2];
  cout << s * s - a[0] * a[0] - a[2] * a[2] - a[4] * a[4];
  return 0;
}
