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