#include <bits/stdc++.h>
using namespace std;
long long a[10];
long long s1, s2, s3, s;
long long a1, a2, a3;
int main() {
  s = s1 = s2 = s3 = 0;
  for (int i = 1; i <= 6; i++) cin >> a[i];
  s = 0;
  s1 = a[1] * 2 + 1;
  a1 = min(a[2], a[6]);
  a2 = min(a[3], a[5]);
  a3 = a[2] + a[3] - a1 - a2;
  for (int i = 0; i < a1; i++) {
    s += s1;
    s1 = s1 + 2;
  }
  s3 = s1 - 1;
  for (int i = 0; i < a3; i++) s += s3;
  s2 = s3 + 1;
  for (int i = 0; i < a2; i++) {
    s2 = s2 - 2;
    s += s2;
  }
  cout << s << endl;
  return 0;
}
