#include <bits/stdc++.h>
using namespace std;
const int dr[]{-1, -1, 0, 1, 1, 1, 0, -1};
const int dc[]{0, 1, 1, 1, 0, -1, -1, -1};
void run() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  run();
  vector<int> v(6);
  for (auto &it : v) cin >> it;
  int i = 1, j = 5, cnt = v[0];
  long long sum = 0;
  while (i != 3 && j != 3) {
    int tmp = cnt;
    if (i == 1 && j == 5)
      cnt++;
    else if (i == 2 && j == 4)
      cnt--;
    sum += tmp + cnt;
    if (--v[i] == 0) i++;
    if (--v[j] == 0) j--;
  }
  if (i != j || cnt != v[3]) assert(false);
  cout << sum << "\n";
}
