#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a[6], mx = 0, mn = 100000000, n, ans, ck;
  for (int i = 0; i < 6; i++) scanf("%I64d", &a[i]);
  for (int i = 0; i < 6; i++) {
    n = a[i] + a[(i + 1) % 6] + a[(i + 2) % 6];
    if (n < mn) {
      mn = n;
      ck = i % 2;
    }
  }
  ans = mn * mn;
  if (ck == 0)
    ans -= a[0] * a[0] + a[2] * a[2] + a[4] * a[4];
  else
    ans -= a[1] * a[1] + a[3] * a[3] + a[5] * a[5];
  printf("%I64d", ans);
}
