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