#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& s, vector<T>& v) {
  s << '{';
  for (int i = 0; i < v.size(); ++i) s << (i ? "," : "") << v[i];
  return s << '}';
}
template <typename S, typename T>
ostream& operator<<(ostream& s, pair<S, T>& p) {
  return s << "(" << p.first << "," << p.second << ")";
}
int go_up[3005];
int go_down[3005];
int main() {
  vector<int> v;
  for (int i = 0; i < (6); ++i) {
    int t;
    cin >> t;
    v.push_back(t);
  }
  go_up[0] = 0;
  go_down[0] = v[5];
  int cur_x = 0;
  int cur_y = 0;
  for (int i = 0; i < (v[0]); ++i) {
    cur_y++;
    cur_x--;
    go_up[cur_y] = cur_x;
  }
  for (int i = 0; i < (v[1]); ++i) {
    cur_y++;
    go_up[cur_y] = cur_x;
  }
  cur_x += v[2];
  int height = cur_y;
  go_down[cur_y] = cur_x;
  for (int i = 0; i < (v[3]); ++i) {
    cur_y--;
    cur_x++;
    go_down[cur_y] = cur_x;
  }
  for (int i = 0; i < (v[4]); ++i) {
    cur_y--;
    go_down[cur_y] = cur_x;
  }
  int tot = 0;
  for (int i = 0; i < (height + 1); ++i) {
    assert(go_down[i] >= go_up[i]);
    if (i == 0 || i == height) {
      tot += (go_down[i] - go_up[i]);
    } else {
      int t = (go_down[i] - go_up[i]);
      tot += 2 * t;
    }
  }
  cout << tot << endl;
}
