The panels are both used in a single piece, 3 repeats of panel B and 2 of panel A.
The directions give you the pattern of sts for panel A and panel B. It would take too much space to repeat those sequences so the patterm designer gives you the sts for the two panels and then in the actual knitting instructions, wherever it says panel A, go to those directions, wherever it says panel B, continue with the panel B instructions. So it'll look like this:
10st rib-panel B-kb1-A-kb1-B-kb1-A-kb1-B-10st rib.
If you add up only the sts without the panels, it adds up to 25 but that's not counting the sts required to do the 5 panels. If you add in the sts required for the panels it should add up to the cast on number.