Teaser 3061: Ratio

From The Sunday Times, 23rd May 2021 [link] [link]

Liam has split a standard pack of 52 cards into three piles; black cards predominate only in the second pile. In the first pile the ratio of red to black cards is 3 to 1. He transfers a black card from this pile to the second pile; the ratio of black to red cards in the second pile is now 2 to 1. He transfers a red card from the first pile to the third pile; the ratio of red to black cards in this pile is now a whole number to one.

Liam told me how many cards (a prime number) were initially in one of the piles; if I told you which pile you should be able to solve this teaser.

How many cards were initially in the third pile?

[teaser3061]