#include <bits/stdc++.h>
using namespace std;
int a[7];
int main() {
  for (int i = 1; i <= 6; i++) scanf("%d", a + i);
  long long prev = 3 + (a[1] - 1) * 2;
  long long ans = 0;
  for (int i = 1; i <= min(a[2], a[6]); i++) {
    ans += prev;
    prev += 2;
  }
  prev = 3 + (a[4] - 1) * 2;
  for (int i = 1; i <= min(a[3], a[5]); i++) {
    ans += prev;
    prev += 2;
  }
  prev -= 2;
  ans += (prev + 1) * (max(a[2], a[6]) - min(a[2], a[6]));
  printf("%lld\n", ans);
  return 0;
}
