Problem 14 in a bunch of languages.