#P2022L. Cards

    ID: 121 Type: Default 1000ms 512MiB Tried: 9 Accepted: 6 Difficulty: 9 Uploaded By: Tags>福建师范大学第19届程序设计竞赛



Time limit: 1 seconds

Memory limit: 512 megabytes

Problem Statement

Cat Fu has a list of cards on his desk. Each card is either red or blue. Cat Fu also has some cards in his pocket, which are also painted red or blue.

Cat Fu doesn't like to see cards of the same color next to each other, so he wants to insert some cards in his pocket into the row of cards on the table so that cards of the same color are not adjacent.

Now he wants to know, to achieve his expectations, how many cards should there be at least on the desk? If this is not possible, he wants to know how many red cards and how many blue cards he needs to meet his expectations.


The first line contains three integers n,r,b(1n,r,b105)n,r,b(1\leq n,r,b\leq 10^5) denoting the number cards , red cards in his pocket and blue cards in his pocket.

The second lines contains a string SS of length nn. It is guaranteed that each character in SS is 'r' or 'b'.


If Cat Fu can meet his expectations with the cards in his pocket print a single integer denoting the minimum possible cards on the desk, else print two integers denoting the number of red cards and blue cards he needs to meet his expectations.

5 2 1

5 2 5

10 1 1
0 2