Okay, you type the EOF character on your keyboard, then come back and talk to us.
First off, main should ALWAYS return an int even if your compiler let's you get away with not returning it.
Second, I think this is what you're looking for:
int c ;
int count ;
while ( ( c = getchar() ) != '\n' )
printf( "%d characters\n" , count );
nouse@NeverlandRanch:~$ gcc count.c -o count