import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools
from collections import Counter

def main():
    n = int(input())
    s = input().rstrip()
    ans = [s[0]]
    now = s[0]
    for i in s[1:]:
        if i != now:
            ans.append(i)
            now = i
    print(len(ans))

if __name__=="__main__":
    main() import math math from math import gcd INF = float("inf") INF float("inf") float "inf" import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline import itertools itertools from collections import Counter def main():
    n = int(input())
    s = input().rstrip()
    ans = [s[0]]
    now = s[0]
    for i in s[1:]:
        if i != now:
            ans.append(i)
            now = i
    print(len(ans)) main n = int(input()) n int(input()) int input() input s = input().rstrip() s input().rstrip() ().rstrip () input rstrip ans = [s[0]] ans [s[0]] s[0] s 0 now = s[0] now s[0] s 0 for i in s[1:]:
        if i != now:
            ans.append(i)
            now = i
     i s[1:] s 1: 1 if i != now:
            ans.append(i)
            now = i
     i != now i now ans.append(i) ans.append ans append i now = i now i print(len(ans)) print len(ans) len ans if __name__=="__main__":
    main() __name__=="__main__" __name__ "__main__" main() main def main():
    n = int(input())
    s = input().rstrip()
    ans = [s[0]]
    now = s[0]
    for i in s[1:]:
        if i != now:
            ans.append(i)
            now = i
    print(len(ans)) def main():
    n = int(input())
    s = input().rstrip()
    ans = [s[0]]
    now = s[0]
    for i in s[1:]:
        if i != now:
            ans.append(i)
            now = i
    print(len(ans)) main input=sys.stdin.readline sys.stdin.readline input INF = float("inf") float("inf") INF
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools
from collections import Counter

def main():
    n = int(input())
    s = input().rstrip()
    ans = [s[0]]
    now = s[0]
    for i in s[1:]:
        if i != now:
            ans.append(i)
            now = i
    print(len(ans))

if __name__=="__main__":
    main()
