A fruit shop sells apples and oranges in the ratio of 3:2. If there are a total of 40 pieces of fruit in the shop, how many apples are there?