#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  int a, b, c, d, e, f, sum = 0;
  int i, j;
  cin >> a >> b >> c >> d >> e >> f;
  sum = (a + d) * (b + c) + b * c + e * f;
  cout << sum;
  return 0;
}
