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