Andrewid the Android is a galaxy-famous detective. In his free time he likes to think about strings containing zeros and ones.

Once he thought about a string of length *n* consisting of zeroes and ones. Consider the following operation: we choose any two adjacent positions in the string, and if one them contains 0, and the other contains 1, then we are allowed to remove these two digits from the string, obtaining a string of length *n* - 2 as a result.

Now Andreid thinks about what is the minimum length of the string that can remain after applying the described operation several times (possibly, zero)? Help him to calculate this number.
First line of the input contains a single integer *n* (1 ≤ *n* ≤ 2·10<sup class="upper-index">5</sup>), the length of the string that Andreid has.

The second line contains the string of length *n* consisting only from zeros and ones.
def ii():
    return int(input())
def li():
    return list(map(int,input().split()))
def si():
    return input()
def ti():
    return map(int,input().split())
def di():
    return deque((map(int,input().split())))
from bisect import bisect_left,bisect_right
from collections import deque
from math import *
def prefixsum(l,n):
    array=[l[0]]
    for i in range(1,n):
        array.append(array[-1]+l[i])
    return array
def suffixsum(l,n):
    array=[0]*n
    temperory=0
    for i in range(n):
        temperory+=l[n-1-i]
        array[n-1-i]=temperory
    return array
def prime(x):
    if x==1:
        return(0)
    elif x==2:
        return(1)
    else:
        t=(sqrt(x))+1
        t=int(t)
        for i in range(2,t):
            if x%i==0:
                return(0)
        else:
            return(1)
def prefixmax(l,n):
    array=[l[0]]
    for i in range(1,n):
        array.append(max(array[-1],l[i]))
    return array
def prefixmin(l,n):
    array=[l[0]]
    for i in range(1,n):
        array.append(min(array[-1],l[i]))
    return array
def BinarySearch(a, x):
 
    i = bisect_left(a, x)
 
    if i != len(a) and a[i] == x:
 
        return i
 
    else:
 
        return -1
def sortremoveDuplicates(arr, n):
    if n == 0 or n == 1:
        return arr
 
    temp = []
    j = 0
    for i in range(0, n-1):
        if arr[i] != arr[i+1]:
            temp += [arr[i]]
            j += 1
    temp += [arr[n-1]]
    return temp
def decimalToBinary(n):
    return bin(n).replace("0b", "")
def ato1(chr):
    return ord(chr)-ord("A")
def permutationindex(l,n):
    arr=[0]*(n)
    for i in range(n):
        arr[l[i]-1]=i
    return arr
def issubsequence(s1, s2):
 
    n, m = len(s1), len(s2)
    i, j = 0, 0
    while (i < n and j < m):
        if (s1[i] == s2[j]):
            i += 1
        j += 1
 
    # If i reaches end of s1,that mean we found all
    # characters of s1 in s2,
    # so s1 is subsequence of s2, else not
    return i == n 
import sys
input=sys.stdin.readline
for _ in range(ii()):
    n=ii()
    s=si()
    x=s.count("1")
    y=n-x
    print(n-2*(min(x,y)))