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