#include <bits/stdc++.h>
using namespace std;
long long i, j, k, l, m, n, s, a[111111], b[111111], c[111111], cc, d, e, f, t;
vector<long long> p[111111], q, r, w, z;
pair<long long, long long> x[111111], y;
vector<long long> u, uu;
int main() {
  cin >> n >> m >> k >> l >> d >> e;
  s = 2 * (n * m + k * l + d * e) + (n - l) * (n - l);
  cout << s;
}
