There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.
Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.
Ultimately, how many slimes will be there?

-----Constraints-----
 - 1 \leq N \leq 10^5
 - |S| = N
 - S consists of lowercase English letters.

-----Input-----
Input is given from Standard Input in the following format:
N
S

-----Output-----
Print the final number of slimes.

-----Sample Input-----
10
aabbbbaaca

-----Sample Output-----
5

Ultimately, these slimes will fuse into abaca.

Difficulty: introductory

Starter code:

Solutions:
N=int(input())
S=input()

ans=S[0]
for s in S:
  if ans[-1]!=s:
    ans+=s
print(len(ans))

N=int(input())
S=list(input())
ans=[]

while len(S)>1:
	if S[0]==S[1]:
		S.pop(0)
	else:
		ans.append(S.pop(0))

print(len(ans)+1)

n = int(input())
s = input()

pre = ''
ans = 0
for c in s:
    if c != pre: ans += 1
    pre = c
print(ans)


N=(int(input()))
S=(str(input()))
ans=1
for i in range(1,N):
  if S[i]==S[i-1]:
    continue
  else:
    ans+=1
print(ans)


N = int(input())
S = str(input())
cnt = 1

for i in range(1,N):
    if S[i] == S[i-1]:
        pass
    else:
        cnt += 1

print(cnt)


n = int(input())
slimes = input()
fusion = [slimes[0]]

cnt = 0

for i in range(1,n):
    if fusion[cnt] != slimes[i]:
        fusion.append(slimes[i])
        cnt += 1

print(cnt+1)

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

# ABC 132 C
N = int(input())
S = str(input())
ans = 1
s = list(map(str, str(S)))

for i in range(N-1):
    if s[i] != s[i+1]:
        ans += 1
print(ans)

N = int(input())
S = list(input())

# N=O(10^5)なのでO(N)で解く
# 同じ文字を1つのグループと見るときに、何グループできるか？
# 文字が変化する点に着目すればよい。するとグループ数は（変化点+1）個と求まる！

ans=1
for i in range(N-1):
  if S[i] != S[i+1]: ans += 1

print(ans)

n = int(input())

s = input()

ans = 1

for i in range(1, n):
    if s[i - 1] != s[i]:
        ans += 1

print(ans)

N = int(input())
S = input()
count = 1
check = S[0]

for c in S:
  if c != check:
    count += 1
    check = c

print(count)

n=int(input())
s=input()
cnt=1
for i in range(n -1):
  if s[i] != s[i +1]:
    cnt += 1
print(cnt)

n = int(input())
s = input()
cnt = 1
for i in range(1, n):
  if s[i] != s[i-1]:
    cnt += 1
print(cnt)

n = int(input())
s = '?' + input()
print((sum(s[i-1] != s[i] for i in range(1, len(s)))))


N=int(input())
S=input()
ans=1
for i in range(N-1):
    if S[i]!=S[i+1]:
        ans+=1
print(ans)


n=int(input())
s=input()
num=n
for i in range(1,n):
    if s[i-1]==s[i]:
        num-=1
print(num)


n = int(input())
s = input()
x = n
for i in range(n-1):
    if s[i] == s[i+1]:
        x -= 1
print(x)

N = int(input())
S = input() + "Z"

ans = 0
for i in range(N):
  if S[i] != S[i+1]:
    ans += 1
print(ans)

N = int(input())
S = input()

for i in range(1, N):
    if(S[i-1] == S[i]):
        N = N-1
print(N)


n=int(input())
S=input()
ans=1
for i in range(len(S)-1):
  if S[i] != S[i+1]:
    ans += 1
print(ans)

N = int(input())
a = list(input())
count = 1
for i in range(N):
  if i>0:
    if a[i-1]==a[i]:
      pass
    elif a[i-1]!=a[i]:
      count+=1
      
print(count)

n = int(input())
s = input()

c = 0
for i in range(n):
  if i == 0 or s[i]!=s[i-1]:
    c += 1
print(c)

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

N = int(input())
S = input()
ans = 1
for i in range(N-1):
    if(S[i] != S[i+1]):
        ans += 1
print(ans)

n = int(input())
s = input()
for i in range(n-1):
  if s[i] == s[i+1]:
    s = s[:i] + " " + s[i+1:]
print(len(s.replace(" ", "")))

N = int(input())
S = input()

ANS = 0
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ANS+= 1

print(ANS + 1)

n = int(input())
s = input()
res = 1
for i in range(n-1):
  if s[i] != s[i+1]:
    res += 1
print(res)

rst = []
N = int(input())
S = input()
tmp_val = ''
for i in S:
    if tmp_val != i:
        rst.append(i)
        tmp_val = i
print(len(rst))

N = int(input())
S = input()
tmp, rst = '', []
for i in S:
    if tmp != i:
        rst.append(i)
        tmp = i
print(len(rst))


N = int(input())
S = str(input())
i = 0
ans = len(S)
for i in range(len(S)-1):
  if S[i] == S[i+1]:
    ans -= 1
print(ans)

N = int(input())
S = list(input())
A = [0] * N
same = False
import math
for i in range(1, N):
  if S[i] == S[i-1]:
    same = True
  elif same and S[i] != S[i-1]:
    A[i] = 1
    same = False
  else:
    same = False
    A[i] = 1
    
print(sum(A)+1)

N = int(input())
S = input()

judge = [1]*N

for i in range(1,N):
    if S[i-1] == S[i]:
        judge[i] = 0

print(sum(judge))

N = int(input())
S = input()

count = 0
for i in range(1, N):
    if S[i-1] != S[i]:
        count += 1

print(count+1)    

# https://atcoder.jp/contests/abc143/tasks/abc143_c
n = int(input())
s = input()

ans = 0
pc = ''
for c in s:
  if c != pc:
    ans += 1
  pc = c

print(ans)


N = int(input())
S = input()
tmp = ''
ls = []
for i in S:
    if i != tmp:
        ls.append(i)
        tmp = i
print(len(ls))

N=int(input())
arr=list(map(str,input()))

ans=1
for i in range(N-1):
    if arr[i]!=arr[i+1]:
        ans+=1
        
print(ans)


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

n = int(input())
s = str(input())
ans = n
for i in range(1,n):
    if s[i-1] == s[i]:
        ans -= 1
print(ans)

import sys

n=int(input())
a=input()
a=list(a)
a.reverse()
if n==1:
    print('1')
    return
    
c=1


for i in range(n-1):
    if a[i]!=a[i+1]:
        c+=1

if c==0:
    c+=1
    
print(c)

N = int(input())
S = str(input())
count = 1

for i in range(N-1):
    if S[i]!=S[i+1]:
        count += 1

print(count)

def resolve():
    n = int(input())
    s = input()
    ans = s[0]
    for i in range(1,n):
        if s[i] != ans[-1]:
            ans += s[i]
    print(len(ans))
resolve()

n = int(input())
s = list(input())
count = n
for i in range(n - 1):
    if s[i] == s[i + 1]:
        count -= 1
print(count)

#!/usr/bin/env python3
def main():
    _ = int(input())
    S = input()

    ans = 0
    res = ""
    for s in S:
        if res == s:
            continue
        res = s
        ans += 1
    print(ans)


def __starting_point():
    main()

__starting_point()

N = int(input())
S = input()
tmp = ''
rst = []
for i in S:
    if tmp != i:
        rst.append(i)
        tmp = i
print(len(rst))

n = int(input())
s = input()
ans = 0
i = 0
while i < n:
    ans += 1
    while i + 1 < n and s[i] == s[i + 1]:
        i += 1
    i += 1
print(ans)


N = int(input())
S = input()

cnt = 1
for i in range(N - 1):
    if S[i] != S[i+1]:
        cnt += 1

print(cnt)

# -*- coding: utf-8 -*-
"""
Created on Wed Sep  9 02:34:35 2020

@author: liang
"""

N = int(input())
S = input()

count = 1
for i in range(N-1):
    if S[i] != S[i+1]:
        count += 1
print(count)

n=int(input())
s=list(input())
for i in range(len(s)-1,0,-1):
    if s[i]==s[i-1]:
        s.pop(i)
print((len(s)))


n = int(input())
s = input()
ans = n

for i in range(n-1):
    if s[i+1] == s[i]:
        ans -= 1
print(ans)

N = int(input())
S = input()

ans = 0
buf = ""
for l in S:
    if buf != l:
        buf = l
        ans += 1
    else:
        pass
print(ans)

n=int(input())
s=input()

c=n

for i in range(0,n-1):
    if s[i]==s[i+1]:
        c-=1

print(c)

n = int(input())
s = input()
ans = 0
p = None
for letter in s:
    if letter != p:
        p = letter
        ans += 1
print(ans)


N=int(input())
S=list(map(str,input()))
i=0
while i!=(len(S)-1):
    if S[i]==S[i+1]:
        S.pop(i+1)
    else:
        i+=1
print(len(S))

import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def LF(): return list(map(float,input().split()))
def Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
    
    
def main():
    N = I()
    S = input().rstrip()
    past = S[0]
    ans = 1
    for i in range(1, N):
        if past != S[i]:
            ans+=1
            past = S[i]
    print(ans)
    
    
    
def __starting_point():
    main()
__starting_point()

n = int(input())
s = input()



for x in range(1,n):
  if s[x] == s[x-1]:
    n -= 1

print(n)


n = int(input())
s = list(input())
color = s[0]
cnt = 1
for i in range(1,n):
    if s[i] != color:
        color = s[i]
        cnt += 1
print(cnt)

N = int(input())
S = input()
s = S[0]
ans = 1

for i in range(N-1):
    if S[i+1] != s:
        ans += 1
        s = S[i+1]

print(ans)

N = int(input())
S = input()
tmp, rst = '', []
for i in S:
    if i != tmp:
        rst.append(i)
        tmp = i
print(len(rst))

n = int(input())
s = input()
slime_end = "0"
num = 0
for i in range(n):
    if s[i] != slime_end:
        num += 1
        slime_end = s[i]
print(num)

N = int(input())
S = input()
tmp, val = '', []
for i in S:
    if i !=tmp:
        val.append(i)
        tmp = i
print(len(val))

N = int(input())
S = input()
ans = 1
for i in range(1, N):
    if S[i] != S[i-1]:
        ans += 1
print(ans)

N = int(input())
S = input()
S = list(S)
color = [0]
j = 0
for i in range(1,N) :
    if S[i-1] == S[i] :
        color.append(j)
    else :
        j += 1
        color.append(j)

print(len(set(color)))

n = int(input())
s = [i for i in input()]
result  = []
tmp = '¥'
for i in range(0,n):
    if tmp != s[i]:
        result.append(s[i])
        tmp = s[i]
print(len(result))

N=int(input())
S=list(map(str,input()))
ans=1
for i in range(N-1):
    if S[i]!=S[i+1]:
        ans+=1
print(ans)

n=int(input())
s=str(input())
ans=1
for i in range(n-1):
  if s[i]!=s[i+1]:
    ans+=1

print(ans)

import itertools

n = int(input())
s = input()
ans = ''
iter = itertools.groupby(s)
for key, value in iter:
    ans += key
print(len(ans))

n = int(input())
s = input()

p = s[0]
ans = s[0]
for w in s:
  if p != w:
    ans += w
  p = w
print(len(ans))

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

#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
import heapq
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
n = I()
s = input()
ans = ""
prv = None
for i in range(n):
    if i == 0:
        prv = s[i]
        ans += s[i]
        continue
    if s[i] == prv:
        continue
    else:
        prv = s[i]
        ans += s[i]
print((len(ans)))


N = int(input())
S = input()


current = ""
ans = ""
for s in S:
    if s != current:
        current = s
        ans += s

print((len(ans)))
# print(ans)





n=int(input());a=input();ans,start=a[0],1
while start<n:
  if a[start-1]!=a[start]:
    ans+=a[start]
  start+=1
print(len(ans))

n = int(input())
s = input()
cnt = 0
for i in range(n-1):
    if s[i] == s[i+1]:
        cnt += 1
print(n-cnt)

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


#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(500000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    N = int(input())
    S = input()
    ans = 1
    pre = S[0]
    for i in range(1, N):
        if S[i] != pre:
            ans += 1
            pre = S[i]
    print(ans)


def main():
    solve()


def __starting_point():
    main()

__starting_point()

N = int(input())
S = input()
pre = S[0]
ans = 1

for s in S:
    if pre != s:
        ans += 1
    pre = s
print(ans)

n = int(input())
s = input()

a = ""
cnt = 0
for i in range(n):
    if i==0:
        a += s[i]
        cnt += 1
    else:
        if s[i] != a[-1]:
            a += s[i]
            cnt += 1
print(cnt)

import itertools
N = int(input())
S = list(input())
gr = list(itertools.groupby(S))
print((len(gr)))


num = int(input())
str1 = input()
table = list(str1)
ans = []

for i in range(num-1):
    if table[i] == table[i+1]:
        continue
    else:
        ans.append(table[i])

print(len(ans) + 1)

n=int(input())
s=input()
t=1
for i in range(1,n):
    if s[i]!=s[i-1]:
        t+=1
print(t)

n = int(input())
c = input()
ans = 1

for i in range(1,n):
  if c[i] != c[i-1]:
    ans += 1
      
print(ans)

N = int(input())
S = input()

cnt = 1
color = S[0]
for i in range(N-1):
    if S[i+1] != color:
        cnt += 1
    color = S[i+1]
print(cnt)

N = int(input())
S = list(input())
 
# N=O(10^5)なのでO(N)で解く
# 連続する同じ文字を1つのグループと見るときに、何グループできるか？
# 文字が変化する点に着目すればよい。するとグループ数は（変化点+1）個と求まる！
 
ans = 1
for i in range(N-1):
  if S[i] != S[i+1]: ans += 1

print(ans)

N=int(input())
S=input()
x=1
for i in range(0,N):
    if i<N-1 and S[i]!=S[i+1] :
        x=x+1
print(x)




def remove_slimes(ls):
	l = [ls[0]]
	for i in range(1, len(ls)):
		if ls[i-1] != ls[i]:
			l.append(ls[i])
	return len(l)

n = int(input())
s = input()
cnt = 1
if len(s) != 1:
	cnt = remove_slimes(list(s))
print(cnt)

import itertools
n = int(input())
S = list(input())
L = [k for k, v in itertools.groupby(S)]
print(len(L))

n=int(input())
s=input()
ans=n
for i in range(len(s)-1):
    if s[i]==s[i+1]:
        ans-=1
print(ans)

N = int(input())
S = input()
ans = 1
for i in range(N - 1):
    if S[i + 1] != S[i]:
        ans += 1
print(ans)


n = int(input())
S = input()
ans = ""
for s in S:
    if ans == "" or ans[-1] != s: ans += s
print(len(ans))

n=int(input())
s=input()
cnt=0
for i in range(n-1):
    if s[i]==s[i+1]:
        cnt += 1
print(n-cnt)

n = int(input())
bef = ""
ans = 0
for s in input():
  if bef != s:
    ans += 1
    bef = s
print(ans)

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

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

n = int(input())
s = '?' + input()
print((sum(s[i-1] != s[i] for i in range(1, n+1))))


N = int(input())
S = input()

res = ""
pre = ""
for s in S:
    if pre != s:
        res += s
    pre = s

print((len(res)))


N=int(input())
S=input()
now=0
num=0
for char in S:
    if char!=now:
        num+=1
        now=char
print(num)

N = int(input())
S = input()
ans = 1

for n in range(1,N):
  if S[n-1]!=S[n]:
    ans+=1
    
print(ans)

n = int(input())
x = list(input())
count = n
for i in range(n-1):
  if x[i]==x[i+1]:
    count-=1
print(count)

input()
S = input()

print(1 + sum(s1 != s2 for s1,s2 in zip(S, S[1:])))

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