#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[7];
  while (scanf("%d", &a[0]) != EOF) {
    int maxx = a[0];
    int minn = a[0];
    int ans = 0;
    for (int i = 1; i < 6; i++) {
      cin >> a[i];
    }
    ans = (a[0] + a[1] + a[2]) * (a[0] + a[2] + a[1]) - a[0] * a[0] -
          a[2] * a[2] - a[4] * a[4];
    cout << ans << endl;
  }
  return 0;
}
