#include <bits/stdc++.h>
using namespace std;
const long double PI = 2 * acos(0);
const long double eps = 1e-15;
const int inf = 1e9 + 7;
const long long Linf = (long long)1e18 + 7;
const int MOD = 1e9 + 7;
const int LMAX = 1e6 + 7;
const int MAX = 1e5 + 7;
const int BASE = 1e9 + 7;
int dx[] = {-1, 0, 0, 1};
int dy[] = {0, -1, 1, 0};
int main() {
  ios::sync_with_stdio(false);
  int a[7], res = 0;
  for (int i = (1); i <= (6); i++) {
    cin >> a[i];
    if (i <= 3) res += a[i];
  }
  res *= res;
  for (int i = (1); i <= (6); i++) {
    if (i & 1) res -= a[i] * a[i];
  }
  cout << res;
  return 0;
}
