#include<stdio.h>
#include<conio.h>
#include<ctype.h>

void main()
{
FILE *fp,*fs;
int s=0,k,z;
char c,fn[10];
clrscr();
scanf("%s",fn);
fp=fopen(fn,"r");
fs=fopen("test.dat","w");
if(fp==NULL) printf("FILE NOT FOUND");


while(1)
{
c=getc(fp);
if(c==EOF)break;
if(!(ispunct(c)))fputc(c,fs);
else fputc(' ',fs);
}
fclose(fp);
fclose(fs);

fs=fopen("test.dat","r");

int count=0;
int c1=0;

while((c=getc(fs))!=EOF)
if(c==' '){c1=1;count++;continue;}
if(c1==1){count--;c1=0;}





printf("\nlength = %d",count);
fclose(fs);
getch();
}