n = int(input())
s = input()
S = []
for i in s:
    S.append(i)
from collections import deque
q = deque(S)
ans = []
while q:
    c  =q.popleft()
    if not ans:
        ans.append(c)
    else:
        while ans and ans[-1]==c:
            ans.pop()
        ans.append(c)

print(len(ans)) n = int(input()) n int(input()) int input() input s = input() s input() input S = [] S [] for i in s:
    S.append(i) i s S.append(i) S.append S append i from collections import deque q = deque(S) q deque(S) deque S ans = [] ans [] while q:
    c  =q.popleft()
    if not ans:
        ans.append(c)
    else:
        while ans and ans[-1]==c:
            ans.pop()
        ans.append(c) q c  =q.popleft() c q.popleft() q.popleft q popleft if not ans:
        ans.append(c)
    else:
        while ans and ans[-1]==c:
            ans.pop()
        ans.append(c) not ans ans ans.append(c) ans.append ans append c while ans and ans[-1]==c:
            ans.pop()
         ans and ans[-1]==c ans ans[-1]==c ans[-1] ans -1 c ans.pop() ans.pop ans pop ans.append(c) ans.append ans append c print(len(ans)) print len(ans) len ans c  =q.popleft() q.popleft() c q = deque(S) deque(S) q ans = [] [] ans n = int(input()) int(input()) n S = [] [] S s = input() input() s
n = int(input())
s = input()
S = []
for i in s:
    S.append(i)
from collections import deque
q = deque(S)
ans = []
while q:
    c  =q.popleft()
    if not ans:
        ans.append(c)
    else:
        while ans and ans[-1]==c:
            ans.pop()
        ans.append(c)

print(len(ans))