#include <iostream>
#include <string>
#include <sstream>

int main() {
	std::string input = "Hello, the wonderful, the awesome and the beautiful world!";
	std::string to_find = "the";
	int foundCount = 0;
    std::stringstream ss( input );
    while ( ss.good() ) {
    	std::string word;
    	ss >> word;
    	if ( word == to_find ) {
    		foundCount++;
    	}
    }
    std::cout << "Input: " << input << std::endl;
	std::cout << to_find << " found " << foundCount << " times" << std::endl;
	return 0;
}