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