Check each possible number of digits, using the smallest and largest numbers of that size.
- 5 digits: the largest product is 99,999×99,999=9,99,98,00,001, which has only 10 digits. Too small.
- 6 digits: the largest product is 99,999×9,99,999=99,99,89,00,001, which has 11 digits. Possible.
- 7 digits: the smallest product is 10,000×10,00,000=10,00,00,00,000, which has 11 digits. Possible.
- 8 digits: the smallest product is 10,000×1,00,00,000, which is 1 followed by 11 zeros, so it has 12 digits. Too big.
So the number of grains in one sack has 6 or 7 digits. (A 5-digit number times a 6-digit number gives 10 or 11 digits; times a 7-digit number it gives 11 or 12 digits.)