#include <iostream>
using namespace std;
#include <boost/algorithm/string.hpp>

size_t word_count( const string & text )
{
	vector<string> words;
	boost::split( words, text, boost::is_any_of(" :-,."), boost::token_compress_on );
	return std::accumulate( words.begin(), words.end(), 0,
	[]( size_t n, const string & s ) -> size_t { return n + (s.size() % 2 == 0 ? 1 : 0);} );
}

int main() {
	cout << word_count("test test abc asdf") << std::endl; //prints 3
	cout << word_count("AAA A AAA") << std::endl; //prints 0
}