#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long qpow(long long a, long long b) {
  long long v = 1;
  for (; b; b >>= 1, a = a * a)
    if (b & 1) v = v * a;
  return v;
}
const int maxn = 5 + 1e5;
long long a, b, c, d, e, f;
int main() {
  cin >> a >> b >> c >> d >> e >> f;
  cout << (b + c + d) * (b + c + d) - b * b - d * d - f * f << endl;
}
