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