#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
template <class T>
typename T::value_type arr_sum(const T& v, int n) {
  typename T::value_type sum = 0;
  for (int i = (0); i < (n); ++i) sum += v[i];
  return sum;
}
struct Sync_stdio {
  Sync_stdio() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
  }
} _sync_stdio;
int main() {
  vector<long long> v(6);
  for (int __i = 0; __i < (6); ++__i) cin >> v[__i];
  ;
  long long res = 0;
  res += (2 * v[0] + min(v[5], v[1])) * min(v[5], v[1]);
  res += (2 * v[3] + min(v[2], v[4])) * min(v[2], v[4]);
  long long t = v[1] + v[2] - min(v[5], v[1]) - min(v[2], v[4]);
  res += 2 * t * (v[0] + min(v[5], v[1]));
  cout << res;
}
