4. (7 points) On the board, 38 ones are written. Every minute, Karlson erases two arbitrary numbers and writes their sum on the board, and then eats a number of candies equal to the product of the two erased numbers. What is the maximum number of candies he could have eaten in 38 minutes?