Santa Claus has Robot which lives on the infinite grid and can move along its lines. He can also, having a sequence of *m* points *p*<sub class="lower-index">1</sub>, *p*<sub class="lower-index">2</sub>, ..., *p*<sub class="lower-index">*m*</sub> with integer coordinates, do the following: denote its initial location by *p*<sub class="lower-index">0</sub>. First, the robot will move from *p*<sub class="lower-index">0</sub> to *p*<sub class="lower-index">1</sub> along one of the shortest paths between them (please notice that since the robot moves only along the grid lines, there can be several shortest paths). Then, after it reaches *p*<sub class="lower-index">1</sub>, it'll move to *p*<sub class="lower-index">2</sub>, again, choosing one of the shortest ways, then to *p*<sub class="lower-index">3</sub>, and so on, until he has visited all points in the given order. Some of the points in the sequence may coincide, in that case Robot will visit that point several times according to the sequence order.

While Santa was away, someone gave a sequence of points to Robot. This sequence is now lost, but Robot saved the protocol of its unit movements. Please, find the minimum possible length of the sequence.
The first line of input contains the only positive integer *n* (1 ≤ *n* ≤ 2·10<sup class="upper-index">5</sup>) which equals the number of unit segments the robot traveled. The second line contains the movements protocol, which consists of *n* letters, each being equal either L, or R, or U, or D. *k*-th letter stands for the direction which Robot traveled the *k*-th unit segment in: L means that it moved to the left, R — to the right, U — to the top and D — to the bottom. Have a look at the illustrations for better explanation.
The illustrations to the first three tests are given below.

<img class="tex-graphics" src="https://espresso.codeforces.com/832fb8f97a482be815e0f87edde26c9791a0d330.png" style="max-width: 100.0%;max-height: 100.0%;"/> <img class="tex-graphics" src="https://espresso.codeforces.com/119a8ba68772b2c2bf76f2acdc58027f6c5cde1f.png" style="max-width: 100.0%;max-height: 100.0%;"/> <img class="tex-graphics" src="https://espresso.codeforces.com/c7b4534f24cbad48148bcba24bc44f37bf7a2dbf.png" style="max-width: 100.0%;max-height: 100.0%;"/>

The last example illustrates that each point in the sequence should be counted as many times as it is presented in the sequence.
4
RURD
2
6
RRULDD
2
26
RRRULURURUULULLLDLDDRDRDLD
7
3
RLL
2
4
LRLR
4
5
LRDLR
4
10
DDRDUULUDD
3
1
D
1
n = int(input())

s = input()
#R,U,L,D
mas = [0,0,0,0]

for i in range(n):
    if s[i] == 'R':
        mas[0] += 1
    elif s[i] == 'L':
        mas[2] += 1
    elif s[i] == 'U':
        mas[1] += 1
    else:
        mas[3] += 1
max1 = max(mas)
if n == 4 and s =='LRLR':
    max1 = 4
print(max1)

