#include <iostream>
#include <string>
#include <set>
#include <cctype>
const std::set<char> consonants = {'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q',
'r', 's', 't', 'v', 'w', 'x', 'y', 'z'};
bool isConsonant(char c)
{
return consonants.count( std::tolower(c) );
}
int main()
{
std::cout << "Please enter a word.\n";
std::string word;
getline(std::cin, word);
std::set<char> unique_consonants;
for(size_t pos = 0; pos < word.length(); ++pos)
if(isConsonant(word[pos]))
unique_consonants.insert( std::tolower(word[pos]) );
std::cout << "Number of different consonant= " << unique_consonants.size() << '\n';
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8c2V0PgojaW5jbHVkZSA8Y2N0eXBlPgoKY29uc3Qgc3RkOjpzZXQ8Y2hhcj4gY29uc29uYW50cyA9IHsnYicsICdjJywgJ2QnLCAnZicsICdnJywgJ2gnLCAnaicsICdrJywgJ2wnLCAnbScsICduJywgJ3AnLCAncScsIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdyJywgJ3MnLCAndCcsICd2JywgJ3cnLCAneCcsICd5JywgJ3onfTsKYm9vbCBpc0NvbnNvbmFudChjaGFyIGMpCnsKICAgIHJldHVybiBjb25zb25hbnRzLmNvdW50KCBzdGQ6OnRvbG93ZXIoYykgKTsKfQoKaW50IG1haW4oKQp7CiAgICBzdGQ6OmNvdXQgPDwgIlBsZWFzZSBlbnRlciBhIHdvcmQuXG4iOyAKICAgIHN0ZDo6c3RyaW5nIHdvcmQ7CiAgICBnZXRsaW5lKHN0ZDo6Y2luLCB3b3JkKTsKCiAgICBzdGQ6OnNldDxjaGFyPiB1bmlxdWVfY29uc29uYW50czsKICAgIGZvcihzaXplX3QgcG9zID0gMDsgcG9zIDwgd29yZC5sZW5ndGgoKTsgKytwb3MpCiAgICAgICAgaWYoaXNDb25zb25hbnQod29yZFtwb3NdKSkKICAgICAgICAgICAgdW5pcXVlX2NvbnNvbmFudHMuaW5zZXJ0KCBzdGQ6OnRvbG93ZXIod29yZFtwb3NdKSApOwogICAgc3RkOjpjb3V0IDw8ICJOdW1iZXIgb2YgZGlmZmVyZW50IGNvbnNvbmFudD0gIiA8PCB1bmlxdWVfY29uc29uYW50cy5zaXplKCkgPDwgJ1xuJzsKfQ==