Mikhail walks on a 2D plane. He can go either up or right. You are given a sequence of Mikhail's moves. He thinks that this sequence is too long and he wants to make it as short as possible.

In the given sequence moving up is described by character U and moving right is described by character R. Mikhail can replace any pair of consecutive moves RU or UR with a diagonal move (described as character D). After that, he can go on and do some other replacements, until there is no pair of consecutive moves RU or UR left.

Your problem is to print the minimum possible length of the sequence of moves after the replacements.


-----Input-----

The first line of the input contains one integer n (1 ≤ n ≤ 100) — the length of the sequence. The second line contains the sequence consisting of n characters U and R.


-----Output-----

Print the minimum possible length of the sequence of moves after all replacements are done.


-----Examples-----
Input
5
RUURU

Output
3

Input
17
UUURRRRRUUURURUUU

Output
13



-----Note-----

In the first test the shortened sequence of moves may be DUD (its length is 3).

In the second test the shortened sequence of moves can be UUDRRRDUDDUUU (its length is 13).

Difficulty: interview

Starter code:

Solutions:
n = int(input())
st = input()
ans = n
i = 1
while i < n:
    if st[i - 1] != st[i]:
        ans -= 1
        i += 1
    i += 1
print(ans)


import getpass
import sys
import math
import random
import itertools
import bisect
import time

files = True
debug = False

if getpass.getuser() == 'frohenk' and files:
    debug = True
    sys.stdin = open("test.in")
    # sys.stdout = open('test.out', 'w')
elif files:
    # fname = "gift"
    # sys.stdin = open("%s.in" % fname)
    # sys.stdout = open('%s.out' % fname, 'w')
    pass


def lcm(a, b):
    return a * b // math.gcd(a, b)


def ria():
    return [int(i) for i in input().split()]


def range_sum(a, b):
    ass = (((b - a + 1) // 2) * (a + b))
    if (a - b) % 2 == 0:
        ass += (b - a + 2) // 2
    return ass


def comba(n, x):
    return (math.factorial(n) // math.factorial(n - x)) // math.factorial(x)


n = ria()[0]
suma = n
st = input()
i = 1

while i < n:
    if st[i] != st[i - 1]:
        i += 2
        suma -= 1
        continue
    i += 1
print(suma)


n = int(input())
s = input()
n = len(s)
i = 0
ans = 0
while i < n-1:
    if s[i] != s[i+1]:
        ans += 1
        i+= 1
    i+= 1
print(n-ans)


n = int(input())
s = input()

ans = n
used = [False for i in range(n)]
for i in range(1, n):
    if not used[i - 1] and (s[i] == 'R' and s[i - 1] == 'U' or s[i] == 'U' and s[i - 1] == 'R'):
        ans -= 1
        used[i] = True
        used[i - 1] = True
print(ans)


n=int(input())
S=input()

index = 0
summ=0

while index+1 < n:

    if S[index]!=S[index+1]:
        summ+=1
        index+=1

    index +=1

print(n-summ)


length = int(input())

line = input().strip()

idx = 0
count = 0

while idx < len(line):
    if idx < len(line) - 1 and line[idx] == 'R' and line[idx+1] == 'U':
        idx += 1

    elif idx < len(line) - 1 and line[idx] == 'U' and line[idx+1] == 'R':
        idx += 1

    count += 1
    idx += 1

print(count)


def check(s):
    for i in range(len(s) - 1):
        if s[i] == 'R' and s[i + 1] == 'U' or s[i] == 'U' and s[i + 1] == 'R':
            return i
    return -1


n = int(input())
s = input()
x = 0
for i in range(100):
    a = check(s)
    if a != -1:
        s = s[:a] + 'D' +  s[a + 2:]
        x += 1
print(len(s))

input()
s = list(input())
found = True

while found:
  x = []
  found = False
  i = 0
  while i < len(s)-1:
    ss = [s[i], s[i+1]] 
    if 'R' in ss and 'U' in ss:
      x.append('D')
      i += 2
      found = True
    else:
      x.append(s[i])
      i += 1
  if i < len(s):
    x.append(s[i])
  s = x
    
print(len(s))

n = int(input())
s = input()
ans = len(s)
i = 0
while (i<len(s)-1):
    if (s[i]=='U') and (s[i+1]=='R'):
        ans = ans-1
        i+=1
    elif (s[i]=='R') and (s[i+1]=='U'):
        ans-=1
        i+=1
    i+=1    
print(ans)        
    
        
    

    


n = int(input())
s = input()
i = 0
ans = 0
while i < n:
    if s[i:i+2] == 'UR' or s[i:i+2] == 'RU':
        i+=1
    i+=1
    ans +=1
print(ans)

n = int(input())
a = input()
o = ''
i=0
while i < n-1:
    #print(i)
    if a[i] != a[i+1]:
        i+=1
        o += 'D'
    i+=1
print(n-len(o))


input()
s=list(input())
ans=0
while len(s)>1:
	a,b=s.pop(),s.pop()
	ans+=1
	if a==b:
		s.append(a)

print(ans+len(s))


n = int(input())
lc = None
for c in input():
	if (lc is None) or (lc == c):
		lc = c
	else:
		n -= 1
		lc = None
print(n)


n = int(input())
s = input()
i = 0
cnt = 0
while i < (n-1):
	if s[i:i+2] == 'UR' or s[i:i+2] == 'RU':
		cnt += 1
		i += 2
	else:
		i += 1

print(n-cnt)



n = int(input())
s = list(input())
for i in range(n - 1):
    if s[i] == 'U' and s[i + 1] == 'R':
        s[i] = 'D'
        s[i + 1] = ''
    if s[i] == 'R' and s[i + 1] == 'U':
        s[i] = 'D'
        s[i + 1] = ''
print(len(''.join(s)))


n=int(input())
s=input()
d=''
d=s[0:2]
count=0
i=1
while i<n:
    if s[i]+s[i-1]=='RU' or s[i]+s[i-1]=='UR':
        count+=1
        i+=2
    else:
        i+=1
print(n-count)

n = int(input())
s = input()
t = len(s)
a = [0] * (n + 10)
cur = 0
for i in s:
    if i == 'U' and cur != 0 and a[cur-1] == 'R':
        cur -= 1
        t -= 1
        a[cur] = 'D'
        cur += 1
    elif i == 'R' and cur != 0 and a[cur-1] == 'U':
        cur -= 1
        t -= 1
        a[cur] = 'D'
        cur += 1
    elif i == 'U' or i == 'R':
        a[cur] = i
        cur += 1
print(t)


n=int(input())

s=input()
a=[s[0],]
for i in range(1,n):
    a.append(s[i])
    if((a[-1]=='U' and a[-2]=='R' ) or (a[-1]=='R' and a[-2]=='U')):
        a.pop()
        a.pop()
        a.append('D')
print(len(a))


n=int(input())
c=input()
i=0
s=0
while i<len(c):
    if i<len(c)-1:
        if c[i+1]!=c[i]:
            s+=1
            i+=2
        else:
            s+=1
            i+=1
    else:
        s+=1
        break
print(s)
        


n = int(input())
s = input()
s += ' '
col = 0
i = 0
while i != n:
    if (s[i] == 'U' and s[i+1] == 'R') or (s[i] == 'R' and s[i+1] == 'U'):
        col += 1
        i += 2

    else:
        i += 1
        col += 1
print(col)


n = int(input())
s = input()
i = 0
while i + 1 < len(s):
    if s[i] == "U" and s[i + 1] == "R" or s[i] == "R" and s[i + 1] == "U":
        s = s[:i] + s[i + 2:]
    else:
        i += 1
print(len(s) + (n - len(s)) // 2)


n=int(input())
s=input()
a=0
i=0
while i < n-1:
    if s[i] != s[i+1]:
        i+=1
        a+=1
    i+=1
print(n-a)


n = int(input())
turns = input().strip()
c = 1
res = len(turns)
while c < (len(turns)):
    if turns[c]!= turns[c-1]:
        res -=1
        c+=1
    c+=1

print(res)





n = int(input())
s = input()
while True:
    used = False
    for i in range(1, len(s)):
        if s[i - 1] + s[i] == "UR" or s[i - 1] + s[i] == "RU":
            s = s[:i - 1] + "D" + s[i + 1:]
            used = True
            break
    if not used:
        break
print(len(s))


input()
s = input()
z = []
prev =""
for el in s:
    if el == "R":
        if prev == "U":
            prev = ""
            z[-1] = 'D'
        else:
            z.append(el)
            prev = "R"
    else:
        if prev == 'R':
            prev = ""
            z[-1] = 'D'
        else:
            z.append(el)
            prev = "U"    
print(len(z))