By Ricardo Martins, IFSULDEMINAS Brazil
Every year, residents of the city of Pipacicaba organize the municipal championship kites. In this place, they use a special type of vine to use as Rabiola the kite. The vine is formed of a single strand formed by normal leaves and adherent sheets. In the examples, normal sheets are represented by a letter 'o' and the adherent sheets formed by a letter 'x'. To take advantage of the various colors of vines, each championship kite can just put a single tape. Each adhesive sheet to be stuck at a single point in the kite base. With this, normal leaves fillets are formed. The two outermost fillets are normally without folds. Internal fillets, always formed by an even number of leaves are bent: Below is an example of vine, and their placement in the kite:
After pasting the adhesive sheets, the Rabiola looks like this:
Fillets appear separated in the image for better viewing. In fact, the threads are superimposed. Its mission is to make an algorithm that, given a vine, enter the size of the largest Rabiola fillet done with it.
The entry has multiple test cases . Each test case is given in one row containing a word composed only of the letters P 'o' and 'x' represents a vine . This word has no more than 100 characters. The entry ends with the end of the file .
For each test case , print a line containing a single integer N , which is the size of the largest Rabiola fillet formed by this vine.
|Input Sample||Output Sample|