#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int32_t main() {
  vector<int> a(6);
  for (int &i : a) cin >> i;
  long long res = 0;
  int cnt = 2 * a[0] + 1;
  for (__typeof(a[1] + a[2] + 1) i = (1) - ((1) > (a[1] + a[2] + 1));
       i != (a[1] + a[2] + 1) - ((1) > (a[1] + a[2] + 1));
       i += 1 - (((1) > (a[1] + a[2] + 1)) << 1)) {
    res += cnt;
    if (i < a[1]) cnt++;
    if (i > a[1]) cnt--;
    if (i < a[5]) cnt++;
    if (i > a[5]) cnt--;
  }
  cout << res << "\n";
  return 0;
}
