9. On the beach, there is a pile of apples that belongs to 3 monkeys. The first monkey comes, divides the apples into 3 equal piles with 1 apple left over, then it throws the extra apple into the sea and takes one pile; the second monkey comes, divides the remaining apples into 3 equal piles, again with 1 apple left over, it also throws the extra apple into the sea and takes one pile; the third monkey does the same. Then, there were at least how many apples originally.