#include <bits/stdc++.h>
using namespace std;
int a[10];
int main() {
  for (int i = 0; i < 6; i++) cin >> a[i];
  long long cnt = 0;
  int minn = min(a[1], a[5]);
  int z = a[0];
  for (int i = 1; i <= minn; i++) {
    cnt += 2 * z + 1;
    z++;
  }
  int k = abs(a[1] - a[5]);
  minn = min(a[2], a[4]);
  z = a[3];
  for (int i = 1; i <= minn; i++) {
    cnt += 2 * z + 1;
    z++;
  }
  cnt += 2 * z * k;
  cout << cnt << endl;
  return 0;
}
