#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int mod = 1e9 + 7;
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first)
    return a.second < b.second;
  else
    return a.first < b.first;
}
long long exp(long long a, long long b) {
  long long ans = 1;
  while (b != 0) {
    if (b % 2) ans = ans * a;
    a = a * a;
    b /= 2;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long arr[10];
  for (long long i = (long long)1; i < (long long)7; i++) {
    cin >> arr[i];
  }
  long long ans = 0;
  ans -= (arr[1] * arr[1] + arr[3] * arr[3] + arr[5] * arr[5]);
  ans += (arr[1] + arr[2] + arr[3]) * (arr[1] + arr[2] + arr[3]);
  cout << ans << endl;
  return 0;
}
