%{
#include<stdio.h>
#include<stdlib.h>
int count=0,space=0,tcount=0,rcount=0;
%}
%%
[\n] count++;
[" "] space++;
\t tcount++;
[^\t" "\n] rcount++;
.;
%%
int main()
{
printf("enter your input: ");
yylex();
printf("the total no. of line are :%d\n" ,count);
printf("the total no. of spaces are :%d\n" ,space);
printf("the total no. of tab are :%d\n" ,tcount);
printf("rest of the character are : %d\n" ,rcount);
return 0;
}

int yywrap(){
return 1;
}