#include <bits/stdc++.h>
using namespace std;
void solve() {
  int a, b, c, d, e, f, tmp, ans = 0, x;
  cin >> a >> b >> c >> d >> e >> f;
  tmp = 2 * a + 1;
  x = min(b, f);
  b -= x;
  f -= x;
  while (x--) {
    ans += tmp;
    tmp += 2;
  }
  b += f;
  tmp--;
  while (b--) ans += tmp;
  tmp--;
  x = min(c, e);
  while (x--) {
    ans += tmp;
    tmp -= 2;
  }
  cout << ans << endl;
}
int main() {
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
}
