Naive implementation of word count algorithm in Erlang