Broken Necklace


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

You have a necklace of N red, white, or blue beads (30) Line 2: a string of N characters, each of which is r, b, or w

The last N=0.

Output

A line containing the maximum of number of beads that can be collected from the supplied necklace.

Sample

Input

29
wwwbbrwrbrbrrbrbrwrwwrbwrwrrb
0

Output

11

Comments

There are no comments at the moment.