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