There were three times as many red candies as blue candies on a table. After Darrel took the same number of red candies and blue candies, there were four times as many red candies as blue candies left on the table. Then after Cloe took $12$ red candies and $12$ blue candies, there were five times as many red candies as blue candies left on the table. Find the total number of candies that Darrel took.
1. Let \( r \) be the number of red candies and \( b \) be the number of blue candies initially. According to the problem, we have:
   \[
   r = 3b
   \]

2. Let \( x \) be the number of candies (both red and blue) that Darrel took. After Darrel took \( x \) red candies and \( x \) blue candies, the number of red candies left is \( r - x \) and the number of blue candies left is \( b - x \). According to the problem, there were four times as many red candies as blue candies left:
   \[
   r - x = 4(b - x)
   \]

3. After Cloe took 12 red candies and 12 blue candies, the number of red candies left is \( r - x - 12 \) and the number of blue candies left is \( b - x - 12 \). According to the problem, there were five times as many red candies as blue candies left:
   \[
   r - x - 12 = 5(b - x - 12)
   \]

4. Substitute \( r = 3b \) into the second equation:
   \[
   3b - x = 4(b - x)
   \]
   Simplify this equation:
   \[
   3b - x = 4b - 4x
   \]
   \[
   3b - x = 4b - 4x
   \]
   \[
   3b - 4b = -4x + x
   \]
   \[
   -b = -3x
   \]
   \[
   b = 3x
   \]

5. Substitute \( b = 3x \) and \( r = 3b = 9x \) into the third equation:
   \[
   9x - x - 12 = 5(3x - x - 12)
   \]
   Simplify this equation:
   \[
   9x - x - 12 = 5(2x - 12)
   \]
   \[
   8x - 12 = 10x - 60
   \]
   \[
   8x - 10x = -60 + 12
   \]
   \[
   -2x = -48
   \]
   \[
   x = 24
   \]

6. Since Darrel took \( x \) red candies and \( x \) blue candies, the total number of candies that Darrel took is:
   \[
   2x = 2 \times 24 = 48
   \]

The final answer is \( \boxed{48} \).