Let r and b represent, respectively, the number of red and blue marbles. We know a couple of things:
- The total number of marbles is 77, so

- The number of blue marbles is five more than twice the number of red marbles, so

So, we have the following system:

The second equation gives a way to express b in terms of r. Use this expression in the first equation:

So, if Jim has 24 red marbles, he has
blue marbles.