#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long> a(6);
  for (int i = 0; i < 6; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < 6; i++) {
    a.push_back(a[i]);
  }
  double s = sqrt(3) / 4.0;
  double r = ((a[0] + a[2]) * 0.5 + a[1]) * (a[0] + a[5]) * sqrt(3) / 2.0;
  r -= a[0] * a[0] * sqrt(3) / 8.0;
  r -= a[2] * a[2] * sqrt(3) / 8.0;
  r -= a[3] * a[3] * sqrt(3) / 8.0;
  r -= a[5] * a[5] * sqrt(3) / 8.0;
  cerr << r << " " << s << endl;
  long long ans = (r + 1e-8) / s;
  cout << ans << endl;
  return 0;
}
