#include <iostream>
using namespace std; const char alphabet[]="abcdefghijklmnopqrstuvwxyz";
const char consonant[]="bcdfghjklmnpqrstvwxz";
const unsigned short cons_len=20;
const unsigned short alp_len=26;
struct word
{
unsigned short s; // Указатель на первый символ слова в стоке S.
unsigned short n; // Количество букв в слове.
};
bool isletter(char); // Буква ли этот символ?
bool isconsonant(char*, word&) // Начинается и заканчивается ли слово согласной?
int main()
{
const unsigned short len = 1000; // Максимальная длина строки.
char S[len+1]; // Данная строка.
word W[len/2+1]; // Массив слов.
unsigned short i=0, u=0, L=0,
z=0, // Количество слов.
k=0; // Кол-во слов удовлетворяющих условию.
W[0].n=0;
while (S[i] && !isletter(S[i])) i++;
while (S[i])
{
if (isletter(S[i]))
{
W[z].n++;
if (W[z].n==1) W[z].s=i;
}
else if (W[z].n!=0) {z++; W[z].n=0;}
i++;
}
for (int i=0; i<j; j++) if (isconsonant(S, W[j]) k++;
cout<<k<<endl;
return 0;
}
bool isletter (char A)
{
for (int i=0; i<alp_len; i++) if (A==alphabet[i]) return true;
return false;
}
bool isconsonant(char* S, word& W)
{
for (int i=0; i<cons_len; i++) if (S[W.s]!=consonant[i]) return false;
for (int i=0; i<cons_len; i++) if (S[W.s+W.n]!=consonant[i]) return false;
return true;
}