You are right that the first pick the probability is 1/5, and the second try is 6/31.
Now that's focus on 6/31. the chance of picking a red counter is 6/31 at the second time, there are 31 counters in total and 6 of them are red, or the multiples of 6/31, which are 12/62, 24/124, and so on.
start with 6/31. if the probability of pick a red at second time is 6/31, the probability at the first time must be 7/32, but 7/32 doesn't make 1/5, so this one doesn't work.
next, try 12/62. P of the first time is then 13/63, which is not equivalent to 1/5 either.
try 24/124. P of the first time is then 25/125, which is exactly 1/5
so there are a total of 125 counters, with 25 red ones and 100 blue ones.