#include <bits/stdc++.h>
using namespace std;
long long fac[2000005] = {0};
void factorial() {
  fac[0] = 1;
  fac[1] = 1;
  for (long long i = 2; i < 200005; i++)
    fac[i] = ((i % 1000000007) * (fac[i - 1] % 1000000007)) % 1000000007;
}
long long power(long long n, long long m) {
  long long p = 1;
  if (m == 0) return 1;
  p = (power(n, m / 2) % 1000000007);
  p = (p % 1000000007 * p % 1000000007) % 1000000007;
  return (m & 1 ? ((p % 1000000007 * n % 1000000007) % 1000000007)
                : (p % 1000000007));
}
long long ncr(long long n, long long r) {
  return ((fac[n] * power(fac[r], 1000000007 - 2)) % 1000000007 *
          power(fac[n - r], 1000000007 - 2)) %
         1000000007;
}
void ram5564() {
  long long a[6];
  for (long long i = 0; i < 6; i++) cin >> a[i];
  long long sum = 2 * a[0] + 1;
  long long cnt = sum;
  a[1] -= 1;
  a[5] -= 1;
  while (a[1] - 1 >= 0 && a[5] - 1 >= 0) {
    cnt += sum + 2;
    sum += 2;
    a[1] -= 1;
    a[5] -= 1;
  }
  sum += 1;
  if (a[5] > 0) {
    while (a[5]-- && a[2]--) {
      cnt += sum;
    }
  } else if (a[1] > 0) {
    while (a[1]-- && a[4]--) {
      cnt += sum;
    }
  }
  long long sum1 = 2 * a[3] + 1;
  cnt += sum1;
  a[2] -= 1;
  a[4]--;
  while (a[2]-- && a[4]--) {
    cnt += sum1 + 2;
    sum1 += 2;
  }
  cout << cnt;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) ram5564();
  cerr << "\n"
       << (float)clock() / CLOCKS_PER_SEC * 1000 << " ms"
       << "\n";
  return 0;
}
