Ivan has a robot which is situated on an infinite grid. Initially the robot is standing in the starting cell (0, 0). The robot can process commands. There are four types of commands it can perform:
 -  U — move from the cell (*x*, *y*) to (*x*, *y* + 1); -  D — move from (*x*, *y*) to (*x*, *y* - 1); -  L — move from (*x*, *y*) to (*x* - 1, *y*); -  R — move from (*x*, *y*) to (*x* + 1, *y*). 
Ivan entered a sequence of *n* commands, and the robot processed it. After this sequence the robot ended up in the starting cell (0, 0), but Ivan doubts that the sequence is such that after performing it correctly the robot ends up in the same cell. He thinks that some commands were ignored by robot. To acknowledge whether the robot is severely bugged, he needs to calculate the maximum possible number of commands that were performed correctly. Help Ivan to do the calculations!
The first line contains one number *n* — the length of sequence of commands entered by Ivan (1 ≤ *n* ≤ 100).

The second line contains the sequence itself — a string consisting of *n* characters. Each character can be U, D, L or R.
none
4
LDUR
4
5
RRRUU
0
6
LLRRRR
4
88
LLUUULRDRRURDDLURRLRDRLLRULRUUDDLLLLRRDDURDURRLDURRLDRRRUULDDLRRRDDRRLUULLURDURUDDDDDLDR
76
89
LDLLLDRDUDURRRRRUDULDDDLLUDLRLRLRLDLDUULRDUDLRRDLUDLURRDDRRDLDUDUUURUUUDRLUDUDLURDLDLLDDU
80
90
RRRDUULLLRDUUDDRLDLRLUDURDRDUUURUURDDRRRURLDDDUUDRLLLULURDRDRURLDRRRRUULDULDDLLLRRLRDLLLLR
84
91
RLDRLRRLLDLULULLURULLRRULUDUULLUDULDUULURUDRUDUURDULDUDDUUUDRRUUDLLRULRULURLDRDLDRURLLLRDDD
76
92
RLRDDLULRLLUURRDDDLDDDLDDUURRRULLRDULDULLLUUULDUDLRLRRDRDRDDULDRLUDRDULDRURUDUULLRDRRLLDRLRR
86
93
RLLURLULRURDDLUURLUDDRDLUURLRDLRRRDUULLRDRRLRLDURRDLLRDDLLLDDDLDRRURLLDRUDULDDRRULRRULRLDRDLR
84
94
RDULDDDLULRDRUDRUUDUUDRRRULDRRUDURUULRDUUDLULLLUDURRDRDLUDRULRRRULUURUDDDDDUDLLRDLDRLLRUUURLUL
86
95
RDLUUULLUURDDRLDLLRRRULRLRDULULRULRUDURLULDDDRLURLDRULDUDUUULLRDDURUULULLDDLDRDRLLLURLRDLLDDDDU
86
96
RDDRLRLLDDULRLRURUDLRLDUDRURLLUUDLLURDLRRUURDRRUDRURLLDLLRDURDURLRLUDURULLLRDUURULUUULRRURRDLURL
84
97
RURDDLRLLRULUDURDLRLLUUDURRLLUDLLLDUDRUULDRUUURURULRDLDRRLLUUUDLLLDDLLLLRLLDUDRRDLLUDLRURUDULRLUR
82
98
RUDURLULLDDLLRDLLRDDLLLLRLDDDDRRRDDRRURLDRLLRUUUDLUUUDDDUDRUURLURUUDUUDRULRRULLRRLRULLULDLUURLULRD
92
99
RRULLDULRRDRULLDUDRUDDDRLLUUDRDDUDURLDDRUUDRRUUURRRURDDLDUURDLRLURRDDLUDDLUDURDRUDDURLURURLRUDRURLD
86
100
UDRLRRLLRRLRRRDDLLDDDLULLDDLURUURUULUDDDRDDLLRDLLUURLRDRLRRLRLLLULDUDDUURRLRDULDRDURRRRRRULDRRDLDRRL
88
1
U
0
5
UUULD
2
1
D
0
5
URLUL
2
5
DDDRU
2
2
LR
2
8
DDRDLDUR
4
6
LLLLUD
2
13
RRRLLLLLLLLLL
6
def minimize_sum(arr):
    # count the number of even and odd elements in the array
    even_count = sum([1 for x in arr if x % 2 == 0])
    odd_count = sum([1 for x in arr if x % 2 != 0])

    # delete elements with different parity until the array is empty
    # or we can't make any more moves
    deletions = 0
    last_deletion = None
    while even_count > 0 and odd_count > 0:
        deletions += 1
        if last_deletion is None:  # first move, can delete any element
            last_deletion = arr.pop(0)
        elif last_deletion % 2 == 0:  # last deleted element was even, so delete odd element
            for i, x in enumerate(arr):
                if x % 2 != 0:
                    last_deletion = x
                    del arr[i]
                    odd_count -= 1
                    break
        else:  # last deleted element was odd, so delete even element
            for i, x in enumerate(arr):
                if x % 2 == 0:
                    last_deletion = x
                    del arr[i]
                    even_count -= 1
                    break

    # calculate the minimum sum of non-deleted elements
    if deletions % 2 == 0:  # Polycarp can't make any more moves
        return sum(arr)
    else:  # Polycarp can delete the whole array
        return 0

n = int(input())
arr = list(map(int, input().split()))
print(minimize_sum(arr))
