open the file

totlines = 0; totchars = 0; fchars = 0; occurences[ all ] = 0;

while it isnt end of file:

read character, say c; add one to totchars;

if c is EOL, addd one to totlines

if c is 0..9 then add one tot figurechars

add one to occurrences[ c ];