Problem1080--Sort photos

1080: Sort photos

[Creator : ]
Time Limit : 1 sec  Memory Limit : 128 MB

Description

Imagine you have a pile of n photos. Some of them are faced upwards and the others faced downwards. Your goal is to sort them so that all the photos are faced the same direction. The only operation you are allowed to do is to take any amount of the photos if their direction is same to the other direction. Write the program that calculates the minimum number of such operations needed to complete the sorting goal.

Input

There are multiple test cases in the input file.
For each test case, the first line is n (0<n<10^5) - the number of photos.
The second line is n characters "D" - faced down or "U" - faced up.

Output

For each test case there is a single integer number - minimal number of flip operations required to sort the photos pile.

Sample Input Copy

5
UUDUU

4
UDUD

Sample Output Copy

1
2

Source/Category