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