#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
int main() {
  vector<pair<double, double> > six = {};
  double alpha = 0;
  for (int i = 0; i < 6; i++) {
    six.push_back({cos(alpha), sin(alpha)});
    alpha += PI / 3.0;
  }
  six.push_back(six[0]);
  vector<pair<double, double> > a = {{0, 0}};
  for (int i = 0; i < 6; i++) {
    double len;
    cin >> len;
    pair<double, double> vec = {six[i + 1].first - six[i].first,
                                six[i + 1].second - six[i].second};
    double d = sqrt(vec.first * vec.first + vec.second * vec.second);
    vec.first /= d;
    vec.second /= d;
    a.push_back(
        {a.back().first + len * vec.first, a.back().second + len * vec.second});
  }
  a.push_back(a[0]);
  double s = 0;
  for (int i = 0; i < 6; i++) {
    s += (a[i].first - a[i + 1].first) * (a[i].second + a[i + 1].second);
  }
  s = abs(s) / 2.0;
  s = s / (sqrt(3) / 4.0);
  cout << int(s) << endl;
}
