#include <bits/stdc++.h>
using namespace std;
const long long MAX_A = 1000ll;
long long arr[8], dp[3 * MAX_A + 5];
int main(int argc, const char* argv[]) {
  for (long long(i) = (1); i <= (long long)(3 * MAX_A); (i)++)
    dp[i] = dp[i - 1] + 2 * i - 1;
  for (long long(i) = (1); i <= (long long)(6); (i)++) scanf("%lld", &arr[i]);
  printf("%lld\n",
         dp[arr[1] + arr[2] + arr[3]] - dp[arr[1]] - dp[arr[3]] - dp[arr[5]]);
  return 0;
}
