#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a[6];
  for (int i = 0; i < 6; i++) cin >> a[i];
  int ans = a[1] + a[2] + a[3];
  ans *= ans;
  for (int i = 1; i < 6; i += 2) ans -= a[i] * a[i];
  cout << ans << endl;
  return 0;
}
