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