There are 6 baskets on the table. Each basket has 5, 2, 7, 8, 12 and 10 apples. John chose second, Olivia chose sixth, Sean chose first, Emma chose third, Liam chose fourth, and Matt chose fifth. How many apples did Matt and John choose in total?