#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(void)
{
  std::vector<std::string> str;
  str.push_back("Vector");
  str.push_back("of");
  str.push_back("four");
  str.push_back("words");

  int chars = accumulate(str.begin(), str.end(), 0, [](int sum, const string& elem) {return sum + elem.size();});

  std::cout << "Number of characters: " << chars; // 17 characters

  // Are there any STL methods that allows me to find 'chars'
  // without needing to write multiple for loops?

}