%{
int count = 0;
%}
%%
[A-Z] {printf("%s capital letter\n", yytext);
count++;}
. {printf("%s not a capital letter\n", yytext);}
\n {return 0;}
%%
int yywrap(){}
int main(){
yylex();
printf("\nNumber of Capital letters in the given input - %d\n", count);
return 0;
}
JXsKaW50IGNvdW50ID0gMDsKJX0KJSUKW0EtWl0ge3ByaW50ZigiJXMgY2FwaXRhbCBsZXR0ZXJcbiIsIHl5dGV4dCk7Cgljb3VudCsrO30KLgkge3ByaW50ZigiJXMgbm90IGEgY2FwaXRhbCBsZXR0ZXJcbiIsIHl5dGV4dCk7fQpcbiB7cmV0dXJuIDA7fQolJQppbnQgeXl3cmFwKCl7fQppbnQgbWFpbigpewp5eWxleCgpOwpwcmludGYoIlxuTnVtYmVyIG9mIENhcGl0YWwgbGV0dGVycyBpbiB0aGUgZ2l2ZW4gaW5wdXQgLSAlZFxuIiwgY291bnQpOwpyZXR1cm4gMDsKfQ==