#include <bits/stdc++.h>
using namespace std;
int main() {
  int input[6];
  for (__typeof(0) i = (0); i < (6); ++i) cin >> input[i];
  int base = input[0], ans = 0, i;
  i = 0;
  while (i < min(input[1], input[5])) {
    ans += (2 * base) + 1;
    base++;
    i++;
  }
  while (i < max(input[1], input[5])) {
    ans += (2 * base);
    i++;
  }
  base = input[3];
  i = 0;
  while (i < min(input[2], input[4])) {
    ans += (2 * base) + 1;
    base++;
    i++;
  }
  cout << ans << endl;
  return 0;
}
