#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, o = 0;
  for (int i = 0; i < 2; ++i) {
    scanf("%d%d%d", &a, &b, &c);
    o += (a + b) * c + a * b;
  }
  printf("%d\n", o);
}
