#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(vector<T> v) {
  for (T e : v) {
    cout << e << " ";
  }
  cout << endl;
}
template <typename T>
void print(vector<vector<T>> v) {
  int n = v.size();
  for (int i = 0; i < n; i++) {
    cout << i << ": ";
    for (T e : v[i]) {
      cout << e << " ";
    }
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  vector<int> a(6);
  for (int i = 0; i < 6; i++) {
    cin >> a[i];
  }
  cout << (int)(pow(a[0] + a[1] + a[2], 2) - a[0] * a[0] - a[2] * a[2] -
                a[4] * a[4])
       << endl;
}
