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