A farmer sells a bushel of soybeans for $5 and a bushel of corn for $3. If he hopes to earn $164 and plans to sell 40 bushels in all, how many bushels of soybeans does he need to sell?