#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
vector<vector<int>> three(vector<int> &a) {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, i, j, k, t, m, x, y;
  cin >> n >> i >> j;
  cin >> k >> t >> m;
  m = n + i + j;
  m = m * m;
  m -= n * n;
  m -= j * j;
  m -= t * t;
  cout << m;
  return 0;
}
