N = int(eval(input()))

S = eval(input())

tmp = S[0]

ret = tmp

for i in S:

  if tmp == i:

    tmp = i

  else:

    ret += i

    tmp = i

print((len(ret)))
#!/usr/bin python3

# -*- coding: utf-8 -*-



def main():

    N = int(eval(input()))

    S = eval(input())

    nw = S[0]

    ret = 1

    for i in range(1,N):

        if nw == S[i]:

            continue

        else:

            nw = S[i]

            ret += 1

    print(ret)



if __name__ == '__main__':

    main()
N = int(eval(input()))
S = eval(input())
tmp = S[0]
ret = tmp
for i in S:
    if tmp == i:
        tmp = i
    else:
        ret += i
        tmp = i
print((len(ret)))

#!/usr/bin python3
# -*- coding: utf-8 -*-
def main():
    N = int(eval(input()))
    S = eval(input())
    nw = S[0]
    ret = 1
    for i in range(1, N):
        if nw == S[i]:
            continue
        else:
            nw = S[i]
            ret += 1
    print(ret)


if __name__ == "__main__":
    main()

-N = int(eval(input())) -S = eval(input()) -tmp = S[0] -ret = tmp -for i in S: -    if tmp == i: -        tmp = i -    else: -        ret += i -        tmp = i -print((len(ret))) +#!/usr/bin python3 +# -*- coding: utf-8 -*- +def main(): +    N = int(eval(input())) +    S = eval(input()) +    nw = S[0] +    ret = 1 +    for i in range(1, N): +        if nw == S[i]: +            continue +        else: +            nw = S[i] +            ret += 1 +    print(ret) + + +if __name__ == "__main__": +    main()