#include <vector>
#include <string>
#include <iostream>

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

  for(int i = 0; i < str.size(); ++i)
    for(int j = 0; j < str[i].size(); ++j)
      ++chars;
  std::cout << "Number of characters: " << chars << std::endl; // 17 characters
  
  chars=0;
  for(int i = 0; i < str.size(); ++i)
    chars+=str[i].size();
  std::cout << "Number of characters: " << chars << std::endl; // 17 characters
  
  chars=0;
  for(auto i : str)
    chars+=i.size();
  std::cout << "Number of characters: " << chars << std::endl; // 17 characters

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

}