#include <bits/stdc++.h>
using namespace std;
int sum, ans, res;
int main() {
  for (int i = 1, x; i <= 6; i++) {
    scanf("%d", &x);
    if (i & 1) sum += x, res += x * x;
    sum += x;
  }
  ans = sum * sum / 9 - res;
  cout << ans << endl;
  return 0;
}
