def run_length(data, init=''):
    length = []
    tmp = init
    cnt = 0
    for c in data:
        if tmp != c:
            length.append(cnt)
            cnt = 0
        tmp = c
        cnt += 1
    length.append(cnt)
    return length


def resolve():
    n = int(input())
    s = input()
    length = run_length(s, '')
    print(len(length) - 1)


if __name__ == "__main__":
    resolve() def run_length(data, init=''):
    length = []
    tmp = init
    cnt = 0
    for c in data:
        if tmp != c:
            length.append(cnt)
            cnt = 0
        tmp = c
        cnt += 1
    length.append(cnt)
    return length run_length length = [] length [] tmp = init tmp init cnt = 0 cnt 0 for c in data:
        if tmp != c:
            length.append(cnt)
            cnt = 0
        tmp = c
        cnt += 1
     c data if tmp != c:
            length.append(cnt)
            cnt = 0
         tmp != c tmp c length.append(cnt) length.append length append cnt cnt = 0 cnt 0 tmp = c tmp c cnt += 1 cnt 1 length.append(cnt) length.append length append cnt return length length data data init='' init '' def resolve():
    n = int(input())
    s = input()
    length = run_length(s, '')
    print(len(length) - 1) resolve n = int(input()) n int(input()) int input() input s = input() s input() input length = run_length(s, '') length run_length(s, '') run_length s '' print(len(length) - 1) print len(length) - 1 len(length) len length 1 if __name__ == "__main__":
    resolve() __name__ == "__main__" __name__ "__main__" resolve() resolve def resolve():
    n = int(input())
    s = input()
    length = run_length(s, '')
    print(len(length) - 1) def resolve():
    n = int(input())
    s = input()
    length = run_length(s, '')
    print(len(length) - 1) resolve def run_length(data, init=''):
    length = []
    tmp = init
    cnt = 0
    for c in data:
        if tmp != c:
            length.append(cnt)
            cnt = 0
        tmp = c
        cnt += 1
    length.append(cnt)
    return length def run_length(data, init=''):
    length = []
    tmp = init
    cnt = 0
    for c in data:
        if tmp != c:
            length.append(cnt)
            cnt = 0
        tmp = c
        cnt += 1
    length.append(cnt)
    return length run_length
def run_length(data, init=''):
    length = []
    tmp = init
    cnt = 0
    for c in data:
        if tmp != c:
            length.append(cnt)
            cnt = 0
        tmp = c
        cnt += 1
    length.append(cnt)
    return length


def resolve():
    n = int(input())
    s = input()
    length = run_length(s, '')
    print(len(length) - 1)


if __name__ == "__main__":
    resolve()
