1. Take a well shuffled deck of cards.
  2. Deal out a card and add to its pip value enough cards to add to 13.
    (Jack = 11, Queen = 12, King = 13)
    In other words, turn over the first card.   Count out enough cards to 13.
    Then put the original card back on top of that pile face down.
  3. Do the same for another pile and continue until you cannot deal another pile.
    Keep remaining cards in your hand.
  4. Have someone pick any three of the piles.
  5. Return all other piles to the cards in your hand.
  6. Turn over the top cards on any 2 of the 3 piles.
  7. From the cards in the deck, deal out 10 cards plus a number equal to each of the turned up cards.
  8. Count the number of cards left.   Announce that number.
  9. Turn up the card on the top of the third pile.

Why does this work?

Let's use some algebra to understand this trick.

Let the original face up card of Pile 1 be a.
Let the original face up card of Pile 2 be b.
Let the original face up card of Pile 3 be c.

In Pile 1, there are 13 - (a - 1) cards.
In Pile 2, there are 13 - (b - 1) cards.
In Pile 3, there are 13 - (c - 1) cards.

In your hand we have 52 - (14 - a + 14 - b + 14 - c) cards.
Simplifying, we get 52 - (42 - a - b - c) = 10 + a + b + c.
So, when you count out 10 + a + b cards, you are left with c cards.