#include <bits/stdc++.h>
using namespace std;
const int oo = 100000000;
int main() {
  long long a[10];
  for (long long i = 0; i < 6; i++) cin >> a[i];
  long long A2 = a[0] * a[0] + a[1] * a[1] + a[1] * a[0];
  long long B2 = a[2] * a[2] + a[3] * a[3] + a[3] * a[2];
  long long C2 = a[4] * a[4] + a[5] * a[5] + a[4] * a[5];
  long long P = 4 * A2 * B2 - (A2 + B2 - C2) * (A2 + B2 - C2);
  P /= 3;
  P = (0.0000000001 + pow(1.0 * P, 0.5));
  P += a[0] * a[1] + a[2] * a[3] + a[4] * a[5];
  cout << P << endl;
  return 0;
}
