filestatistics(F1) :- see(F1), countchar(0), seen. countchar(X) :- get0(C), countchar1(C, X). countchar1(-1, X) :- write(X), !. countchar1(_, X) :- Y is X+1, countchar(Y).