map{s/[^a-z ]//gi;map{$d{+lc}++}split}<>;print"$d{$_} $_ "for sort keys%d