problem 20, brute force