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