#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 6, m = 0, ans = 0;
  vector<int> A(n, 0);
  for (int i = 0; i < n; i++) cin >> A[i];
  m = 1 + A[1] + A[2];
  vector<int> B(m, 0);
  B[0] = A[0];
  B[m - 1] = A[3];
  for (int i = 1; i <= min(A[1], A[5]); i++) B[i] = B[i - 1] + 1;
  for (int i = m - 1; i > max(A[5], A[1]); i--) B[i - 1] = B[i] + 1;
  for (int i = 1; i < m - 1; i++)
    if (B[i] == 0) B[i] = B[min(A[1], A[5])];
  for (int i = 1; i < m - 1; i++) ans += 2 * B[i];
  ans += B[0] + B[m - 1];
  cout << ans;
  return 0;
}
