#!/usr/bin/env python

# coding: utf-8



def ri():

    return int(eval(input()))



def rl():

    return list(input().split())



def rli():

    return list(map(int, input().split()))



def main():

    n = ri()

    s = eval(input())

    ans = 1

    for i in range(1, len(s)):

        if s[i] == s[i-1]:

            continue

        ans += 1

    print(ans)





if __name__ == '__main__':

    main()

#!/usr/bin/env python

# coding: utf-8



def ri():

    return int(eval(input()))



def rl():

    return list(input().split())



def rli():

    return list(map(int, input().split()))



def main():

    n = ri()

    s = eval(input())

    bc = '!'

    ans = 0

    for c in s:

        if c != bc:

            ans += 1

        bc = c

    print(ans)





if __name__ == '__main__':

    main()

#!/usr/bin/env python
# coding: utf-8
def ri():
    return int(eval(input()))


def rl():
    return list(input().split())


def rli():
    return list(map(int, input().split()))


def main():
    n = ri()
    s = eval(input())
    ans = 1
    for i in range(1, len(s)):
        if s[i] == s[i - 1]:
            continue
        ans += 1
    print(ans)


if __name__ == "__main__":
    main()

#!/usr/bin/env python
# coding: utf-8
def ri():
    return int(eval(input()))


def rl():
    return list(input().split())


def rli():
    return list(map(int, input().split()))


def main():
    n = ri()
    s = eval(input())
    bc = "!"
    ans = 0
    for c in s:
        if c != bc:
            ans += 1
        bc = c
    print(ans)


if __name__ == "__main__":
    main()

-    ans = 1 -    for i in range(1, len(s)): -        if s[i] == s[i - 1]: -            continue -        ans += 1 +    bc = "!" +    ans = 0 +    for c in s: +        if c != bc: +            ans += 1 +        bc = c