Bag A contains 5x coins. Bag B contains 3x coins. 8 coins are taken from Bag B and put into Bag A. The ratio of coins in Bag A to Bag B is now 11:5. Work out the total number of coins.

Let's start by setting up equations to represent the given information:

Bag A has originally 5x coins, and after adding 8 coins from Bag B, it has a new total of 5x + 8 coins.

Bag B has originally 3x coins, and after 8 coins are removed from it, it has a new total of 3x - 8 coins.

Now we can set up an equation based on the ratio of coins in the two bags:

(5x + 8) / (3x - 8) = 11/5

To solve for x, we can cross-multiply and simplify:

5(5x + 8) = 11(3x - 8)

25x + 40 = 33x - 88

88 + 40 = 33x - 25x

128 = 8x

x = 16

This means that Bag A originally had 5x = 80 coins, and Bag B originally had 3x = 48 coins. After 8 coins were moved from Bag B to Bag A, Bag A had a total of 88 coins and Bag B had a total of 40 coins.

Therefore, the total number of coins is 88 + 40 = <<88+40=128>>128.