#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[6];
  for (int i = 0; i < 6; i++) cin >> a[i];
  int space = 0.0;
  for (int i = 0; i < 6; i += 2) space += a[i] * a[i + 1];
  space *= 2;
  space += (a[0] - a[3]) * (a[0] - a[3]);
  cout << space;
  return 0;
}
