Problem #9 (naive)