Problem 14.  Dumb solution runs fast enough