#include <bits/stdc++.h>
int main(void) {
  int a[6], i = 0, min = 0;
  int sum = 0;
  while (i < 6) {
    scanf("%d", &a[i]);
    i++;
  }
  if (a[1] < a[5])
    min = a[1];
  else
    min = a[5];
  i = (2 * a[0] + 1) + (min - 1) * 2;
  sum += min * (2 * (2 * a[0] + 1) + (min - 1) * 2) / 2;
  if (a[1] < a[5])
    min = a[5] - min;
  else
    min = a[1] - min;
  i += 1;
  sum += i * min;
  if (a[2] < a[4])
    min = a[2];
  else
    min = a[4];
  i -= 1;
  sum += min * (2 * (i) + (min - 1) * (-2)) / 2;
  printf("%d", sum);
  return 0;
}
