Toby has found a game to entertain himself.The game is like this:

You are in a coordinate system initially at (0,0) and you are given a sequence of steps which lead to your destination.The steps are given in the form of directions: ’U’ ,’D’ , ’L’ and ‘R’ for up, down, left and right respectively.If you are at position (x,y) then:
- U:move to (x,y+1)
- D:move to (x,y-1)
- L:move to (x-1,y)
- R:move to (x+1,y)
The sequence is provided as a string ‘s’ of characters where $s_i$ $(1 \leq i \leq N)$ is one of the direction character as mentioned above.An example of a sequence of steps is:   UULRUDR

The destination according to this string is (1,2).

You want to remove maximum number of characters from the string such that the resulting string leads to the same destination as before.
For example in the example above we can remove characters at positions 1,3,4,6 and the resulting path will be UUR which will lead to the same destination i.e (1,2).so we reduced the number of steps by 4,and this is our score.
You need to get maximum score.

-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- First line of each testcase contains a single integer $N$,size of string. 
- Second line of testcase contains a string $s$ of size $N$.

-----Output:-----
For each testcase, output a single line containing the maximum score possible.

-----Constraints-----
- $1 \leq T \leq 1000$
- $1 \leq N \leq 10^5$

-----Sample Input:-----
3

7

ULUDLLU

4

RUUR

4

LRLR   

-----Sample Output:-----
2

0

4    

-----EXPLANATION:-----
- 
test case 1:
The final destination after moving according to the sequence is (-3,2).

One way is to remove characters at positions 3,4 and the resulting string will be ULLLU and destination still remains (-3,2).
- 
test case 2: No character can be removed in this case.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "# cook your dish here\nimport sys\nimport math\nfrom collections import Counter\ndef inputt():\n return sys.stdin.readline().strip()\ndef printt(n):\n sys.stdout.write(str(n)+'\\n')\ndef listt():\n return [int(i) for i in inputt().split()]\ndef gcd(a,b): \n return math.gcd(a,b) \n \ndef lcm(a,b): \n return (a*b) / gcd(a,b) \nt=int(inputt())\n\ndef SieveOfEratosthenes(n):  \n s=0\n prime = [True for i in range(n + 1)] \n p = 2\n while (p * p <= n): \n  \n  \n  if (prime[p] == True): \n   \n   for i in range(p * 2, n + 1, p): \n    prime[i] = False\n  p += 1\n prime[0]= False\n prime[1]= False\n for p in range(n + 1): \n  if prime[p]: \n   s+=p\n l=list(str(s))\n print(l[-1]) \n\n\n\nfor _ in range(t):\n n=int(inputt())\n s=inputt()\n dic=Counter(s)\n c=0\n c+=abs(dic['U']-dic['D'])+abs(dic['L']-dic['R'])\n printt(n-c)"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14709