Miners
At two coal mines working miners, whose performance depends on the diversity of food they consume.
Food comes to the shaft and boxes come in three types: meat, fish and bread (yes, you can ponostalgirovat, if ten years ago played "Settlers II"). When the mine comes another box of food, miners extract a certain amount of coal, depending on the contents of the box, as well as the previous two boxes, which they received (or less than two, if they so much have not yet received), as follows:
If all three (or less) boxes of the same type, they get one piece of coal;
If among these three (or less) boxes are two types of food, they get two units of coal;
If among these three boxes of all three types of food, they get three units of coal.
You know in advance the sequence in which the box will be delivered to a mining town. Your task - to distribute this sequence on the two shafts so that the total amount of coal mined is maximized.
Boxes can not be "postponed" and divide into two parts: box came to be immediately sent to either the first shaft, or the second. The number of boxes delivered to each of the mines can be arbitrary, to the point that all the boxes can be sent to a mine, if it is profitable for business. (By the way, if you become a statesman in the future. employee, because to do so just do not!)
Input
The first line contains the number n - the number of boxes of food (1 ≤ n ≤ 100000), the second - a string of length n, consisting of the characters "M", "F" and "B", indicating, respectively, a box of meat, fish and bread, and listed in the order in which the boxes will be delivered.
Output
Bring out one number - the maximum amount of coal that will be able to get the miners in these conditions.