Suppose the values of the cards at the bottom of the three piles are a, b
and c.
The three piles contain 14-a, 14-b and 14-c cards respectively,
so the magic counting pile contains 52 - (14-a) - (14-b) - (14-c) = 10 + a + b + c cards.
Suppose we turn over piles a and b. We count out a + b + 10 cards, leaving
exactly c in the magic counting pile.
Ta-da! Delightful.