/* Program prepisuje ulazni fajl u izlazni i pritom prebrojava slovne karaktere */

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

int main(){

	FILE *ulaz = fopen("ulazni.txt", "r");
	FILE *izlaz = fopen("izlazni.txt", "w");
	char c;
	int broj=0;

	if(ulaz==NULL || izlaz==NULL){
		printf("-1");
		exit(EXIT_FAILURE);
	}
		
	while((c=fgetc(ulaz))!=EOF){
		fputc(c, izlaz);
		if(isalpha(c))
			broj++;
	}

	printf("%d\n", broj);

	fclose(ulaz);
	fclose(izlaz);
}
