Diwali is the festival of lights. Pari loves lights, so she bought an infinite number of red and blue bulbs. She also likes regular arrangements, so she lays the bulbs out in one line by repeating a finite pattern S forever.
For example, if S is BBRB, the bulbs are placed in the order BBRBBBRBBBRB.... Here B means blue and R means red.
The bulbs are numbered with consecutive integers starting from 1. The arrangement above is numbered like this.
B B R B B B R B B B R B...
1 2 3 4 5 6 7 8 9 10 11 12
Blue is Pari's favorite color. Count the blue bulbs from bulb I through bulb J, inclusive.