%{
/* Declarations */
int wordCount = 0;
int lineCount = 0;
%}

%%
[a-zA-Z]+    { wordCount++; }    /* Count words */
\n           { lineCount++; }    /* Count newlines */
.            ;                   /* Ignore all other characters */

%%
int main() {
    yylex();
    printf("Number of words: %d\n", wordCount);
    printf("Number of lines: %d\n", lineCount);
    return 0;
}

int yywrap() {
    return 1;
}