Pancakes#1596

Pancakes

1 second
64 megabytes
Easy

Boy Pete decided to prepare his mother a birthday present — a festive breakfast. He decided to make delicious tea and bake pancakes. Unfortunately, not distinguished by outstanding culinary skills, Pete was unable to keep up with the pancakes. Each of them turned out burnt on one side and underdone on the other. As a result, Pete got black and white pancakes. He put all the pancakes on a large plate, one on top of the other. Now, Pete wants to flip them so that they are all light side up — Pete thinks his mother would like this. To flip the pancakes, he has a spatula, with which he may take any number of top pancakes (from one up to the whole stack) and flip them all together (so that the top pancake will be in the place of the bottom pancake from those that are flipped).

What is the minimum number of such actions Pete should make to turn all the pancakes light side up?

Input

The first line of the input file contains a number (1 \leq N \leq 100\,000) — the number of pancakes. The next lines describe the pancakes, from top to bottom. If the -th row is the symbol W, then the -th pancake is underdone side up, and if B, then the burnt side is up.

Output

Output a single number — the minimum number of flips that Pete should make to turn all the pancakes underdone side up.

Examples

Example 1

Loading
Loading