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.


-----Input-----

First line of the input contains a single integer n (1 ≤ n ≤ 2·10^5), the length of the string that Andreid has.

The second line contains the string of length n consisting only from zeros and ones.


-----Output-----

Output the minimum length of the string that may remain after applying the described operations several times.


-----Examples-----
Input
4
1100

Output
0

Input
5
01010

Output
1

Input
8
11101111

Output
6



-----Note-----

In the first sample test it is possible to change the string like the following: $1100 \rightarrow 10 \rightarrow(\text{empty})$.

In the second sample test it is possible to change the string like the following: $01010 \rightarrow 010 \rightarrow 0$.

In the third sample test it is possible to change the string like the following: $11101111 \rightarrow 111111$.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
a = input()
kol1 = 0
kol0 = 0
for i in range(len(a)):
    if a[i] == "1":
        kol1 += 1
    else:
        kol0 += 1
print(abs(kol1 - kol0))


n = int(input())

s = input()

z = 0
o = 0

for i in s:
    if i == '0':
        z += 1
    else:
        o += 1

print(abs(z-o))

import math,string,itertools,fractions,heapq,collections,re,array,bisect,copy
from itertools import chain, dropwhile, permutations, combinations
from collections import defaultdict, deque

# Guide:
#   1. construct complex data types while reading (e.g. graph adj list)
#   2. avoid any non-necessary time/memory usage
#   3. avoid templates and write more from scratch
#   4. switch to "flat" implementations

def VI(): return list(map(int,input().split()))
def I(): return int(input())
def LIST(n,m=None): return [0]*n if m is None else [[0]*m for i in range(n)]
def ELIST(n): return [[] for i in range(n)]
def MI(n=None,m=None): # input matrix of integers
    if n is None: n,m = VI()
    arr = LIST(n)
    for i in range(n): arr[i] = VI()
    return arr
def MS(n=None,m=None): # input matrix of strings
    if n is None: n,m = VI()
    arr = LIST(n)
    for i in range(n): arr[i] = input()
    return arr
def MIT(n=None,m=None): # input transposed matrix/array of integers
    if n is None: n,m = VI()
    a = MI(n,m)
    arr = LIST(m,n)
    for i,l in enumerate(a):
        for j,x in enumerate(l):
            arr[j][i] = x
    return arr


def run(n,x,l,r):
    s = 0
    curr = 1
    for i in range(n):
        skip = (l[i]-curr) // x
        s += r[i]-curr-skip*x+1
        curr = r[i]+1
    print(s)


def main(info=0):
    n = I()
    s = list(input())
    print(n- min(s.count('0'), s.count('1'))*2)

def __starting_point():
    main()

__starting_point()

n = int(input())
str = input()
a = str.count("0")
b = str.count("1")
if a-b > 0 :
    print(a-b)
else:
    print(b-a)




a = input()
a = input()

print(abs(len(list([x for x in a if x == '1'])) - len(list([x for x in a if x == '0']))))





n = int(input())
s = input()
stack = []
for c in s :
          if stack==[] : stack.append(c)
          elif stack[len(stack)-1]+c=='10' or stack[len(stack)-1]+c=='01' : stack.pop(len(stack)-1)
          else : stack.append(c)
print(len(stack))


_ = input()
s = input()

ans = 0
for i in range(len(s)):
	if s[i] == '1':
		ans += 1

	if s[i] == '0':
		ans -= 1

print(abs(ans))

__author__ = 'Andrey'
n = int(input())
num = input()
stack = []
for char in num:
    if len(stack) == 0:
        stack.append(char)
    elif char != stack[-1]:
        stack.pop()
    else:
        stack.append(char)
print(len(stack))

R = lambda: list(map(int, input().split()))

input()
s=input()
n=len(s)
n0 = s.count('0')
n1 = s.count('1')
print(max(n - n0*2, n-n1*2))


def main():
    n = input()
    s = input()
    d = {'0':0,'1':0}
    for c in s:
        d[c] += 1
    print(len(s)-min(d['0'],d['1'])*2)
    
def __starting_point():
    main()

__starting_point()

n=int(input())
a=input()
cnt0=0
cnt1=0
for i in range(n):
    if a[i]=='0':
        cnt0+=1
    else:
        cnt1+=1
print(abs(cnt1-cnt0))


n = int(input())
str = input()
zero = 0
one = 0
for char in str:
    if char == '0':
        zero+=1
    else:
        one+=1
count = min(zero, one)
print(n-(count*2))

n = int(input())
s = input()
k = 0
for i in s:
    if i == '0':
        k +=1
print(abs(n - 2 * k))


n = int(input())
s = input()
d = []
for i in s:
    d.append(i)
    if len(d) >= 2:
        if d[-1] == '0' and d[-2] == '1' or d[-1] == '1' and d[-2] == '0':
            d.pop()
            d.pop()
print(len(d))



def main():
    input()
    s = input()
    one = 0
    zero = 0
    for ch in s:
        if ch == '0':
            one += 1
        else:
            zero += 1

    print(abs(one-zero))

def __starting_point():
    main()
__starting_point()

n = int(input())
a = list(map(int, input()))
d = []
for i in range(len(a)):
   d.append(a[i])
   while  len(d) >= 2 and d[-1] + d[-2] == 1:
     d.pop()
     d.pop()
     n -= 2
print(n)


n = int(input())
s = input()
s = list(map(int, s))
print(abs(s.count(1) - s.count(0)))

import string
n = input()
s = str(input())
z_count = 0
o_count = 0
for i in s:
   if i == '1':
       o_count += 1
   if i == '0':
       z_count += 1
ans = abs(o_count - z_count)
print(ans)

from sys import stdin
input = stdin.readline
a = input()
s = input().rstrip("\n")
a = s.count("1")
b = s.count("0")
print(abs(a-b))


#!/usr/bin/env python3

n = input()
s = input()

n_o = len(list(i for i in s if i == '1'))
n_z = len(list(i for i in s if i == '0'))

print(max(n_o, n_z) - min(n_o, n_z))

n = int(input())
l = input()
n = 0
for e in l:
    n += (int(e) << 1) - 1
print(abs(n))
    
    


luv=input()
cf=input()
onegod=0
zerogod=0
for I in cf:
    if I=='1':
    
        onegod += 1
        
zerogod = len(cf)-onegod
print(abs(onegod-zerogod))

l = int(input())
s = input()

print(abs(s.count('1') - s.count('0')))


n = int(input())
s = input()
zeros = s.count('0')
ones = s.count('1')
print(n - min(zeros, ones)*2)

import re

def __starting_point():
    x = int(input())
    s = input()
    zeros, ones = 0, 0
    for char in s:
        if char == '0':
            zeros += 1
        if char == '1':
            ones += 1    
    print(abs(zeros-ones))

__starting_point()