//
import java.io.*;
public class compteur {
public static void main(String args[]){
int nNombres=0;
int nMots=0;
FileInputStream fis=null;
StreamTokenizer st=null;
try
{fis=new FileInputStream(args[0]);
st=new StreamTokenizer(fis);}
catch (IOException e)
{System.out.println("usage : java compteur ");
try {fis.close();} catch (IOException e1) {};
System.exit(1);}
st.eolIsSignificant(true);
st.wordChars((int) '_',(int)'_');
st.ordinaryChar((int) '.');
try
{while (st.nextToken()!=st.TT_EOF)
{if (st.ttype== st.TT_WORD)
{System.out.println(st.sval);
nMots++;}
if (st.ttype== st.TT_NUMBER)
{System.out.println(st.nval);
nNombres++;}
} } // while
catch (IOException e)
{System.out.println("error when reading.");}
finally
{try {fis.close();} catch (IOException e1) {};}
System.out.println("mots : "+ nMots);
System.out.println("nombres : "+ nNombres);
} //main
}