#include <iostream>
#include <numeric>
#include <vector>

using namespace std;

int main() {
  const vector<int> box = { 2, 3, 4, 6 };

  cout << accumulate(next(cbegin(box)), cend(box), box.front() * (box.size() - 1), [i = box.size()](const auto lhs, const auto rhs) mutable { return lhs + rhs * --i; }) << endl;
}