Valery bought 54 markers in all.
Let's denote the cost of each pencil as p and the cost of each marker as 2p. Valery spent 1/5 of her money buying 8 pencils and 2 markers. She used 5/8 of her remaining money buying more markers. Let's represent the total amount of money Valery had as M.
The cost of 8 pencils is 8p, and the cost of 2 markers is 2(2p) = 4p.
Valery spent 1/5 of her money on pencils and markers, so she spent (8p + 4p)/5 of her money on them.
The remaining amount of money, M - (8p + 4p)/5, she used to buy more markers.
Valery used 5/8 of this remaining amount to buy more markers, so she bought (5/8)(M - (8p + 4p)/5) markers.
Now, we can set up an equation to represent the situation:
(8p + 4p)/5 + (5/8)(M - (8p + 4p)/5) = M
Simplifying the equation, we get:
12p/5 + (5/8)M - (8p + 4p)/5 = M
12p/5 + (5/8)M - 8p - 4p/5 = M
(4/5)p + (5/8)M = M + 4p/5
(4/5)p = M - 4p/5
p = (M - 4p/5)/4
Now, we can solve for M:
M = 4p + 5p/4
M = (4/5)p + (5/4)p
M = (9/20)p
Since there are 100 cents in a dollar, we can represent the total amount of money Valery had as M = 9/20 * 100 = 4.5.
Next, we can find the cost of one pencil:
p = (4.5 - 4p/5)/4 = (4.5 * 5)/4 = 22.5
Now, we can find the number of markers Valery bought. Since each marker cost twice as much as each pencil, the cost of one marker is 2 * 22.5 = 45.
Valery spent (8 * 22.5 + 2 * 45) / 5 of her money on pencils and markers, which is (180 + 90) / 5 = 270 / 5 = 54.
Therefore, Valery bought 54 markers in all.