#include <bits/stdc++.h>
using namespace std;
int a[10];
double Area(int x) { return (double)x * x * sqrt(3) / 2 / 2; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  for (int i = 1; i <= 6; i++) cin >> a[i];
  int b = a[1] + a[2] + a[3];
  int c = a[3] + a[4] + a[5];
  int d = a[5] + a[6] + a[1];
  double p = (d + b + c) / 2.0;
  double S = sqrt(p * (p - b) * (p - c) * (p - d));
  double Sb = Area(a[1]);
  double Sc = Area(a[3]);
  double Sd = Area(a[5]);
  S = S - Sb - Sc - Sd;
  S = S / (Area(1));
  cout << (long long)S;
  return 0;
}
