#include <iostream>
#include <string>
#include <set>

int count(std::string input)
{
	static const std::set<char> delimeters{' ', '.', ',', ':', '-'};
	static const std::set<char>::iterator _end = delimeters.end();
	
	int word_count{};
	int state{};
	for (std::string::iterator it=input.begin(); it!=input.end(); ++it)
		if (delimeters.find(*it) == _end) state++;
		else
		{
			word_count+= state > 0 ? (state+1)%2 : 0;
			state = 0;
		}
		
	word_count+= state > 0 ? (state+1)%2 : 0;
	
	return word_count;
}


int main() {
	// your code goes here
	
	std::cout << count("- one, two,three . four :five");
	
	return 0;
}