#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int ans = 0;
  int a[7];
  for (int i = 1; i < 7; ++i) {
    cin >> a[i];
  }
  int x, y, z;
  x = min(a[1], a[3]);
  while (x--) {
    ans = ans + (2 * a[2] + 1);
    a[2]++;
  }
  ans += (2 * a[2] * (max(a[1], a[3]) - min(a[1], a[3])));
  x = min(a[4], a[6]);
  while (x--) {
    ans += (2 * a[5] + 1);
    a[5]++;
  }
  cout << ans;
  return 0;
}
