#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
string make_plural(size_t ctr, const string &word, const string &ending)
{
return (ctr > 1) ? word + ending : word;
}
void elimDups(vector<string> &words)
{
sort(words.begin(), words.end());
auto end_unique = unique(words.begin(), words.end());
words.erase(end_unique, words.end());
}
void biggies(vector<string> &words, vector<string>::size_type sz)
{
elimDups(words);
stable_sort(words.begin(), words.end(), [](const string &s1, const string &s2) {return s1.size() < s2.size(); });
auto wc = find_if(words.begin(), words.end(), [sz](const string &a) {return a.size() >= sz; });
auto count = words.end() - wc;
cout << count << " " << make_plural(count, "word", "s") << " of length " << sz << " or longer " << endl;
for_each(wc, words.end(), [](const string &s) { cout << s << endl; });
cout << endl;
}
int main()
{
vector<string> vec;
string s;
while (cin >> s)
{
vec.push_back(s);
}
biggies(vec, 5);
return 0;
}