n = int(input())
s = list(input())
c = 1
ans = 0
for i in range(n-1):
    if s[i]!=s[i+1]:
        if c==1:
            ans+=1
            c+=1
            s[i+1] = s[i]
        else:
            c=1
    else:
        c+=1
if c==1:ans+=1
print(ans)
