Unoptimized problem 12. Pretty slow!