#include <iostream>
#include <string>
using namespace std;

int main() {
	size_t count_words = 0;
	string word, longest_word, shortest_word;

	cout << "Type a text:" << endl;

	while (cin >> word)
	{
    	++count_words;
	    if (word.size() > longest_word.size())
    	    longest_word = word;
    	if (shortest_word.empty() || word.size() < shortest_word.size())
        	shortest_word = word;
	}

	cout << "The text contains " << count_words << " word(s)." << endl;
	if (count_words > 0) {
    	cout << "The shortest word is " << shortest_word << "." << endl;
	    cout << "It has " << shortest_word.size() << " character(s)." << endl;
    	cout << "The longest word is " << longest_word << "." << endl;
	    cout << "It has " << longest_word.size() << " character(s)." << endl;
	}

	return 0;
}