Problem:
 Score : 300 points    Problem Statement 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 1 10
aabbbbaaca      Sample Output 1 5  Ultimately, these slimes will fuse into abaca .       Sample Input 2 5
aaaaa      Sample Output 2 1  All the slimes will fuse into one.       Sample Input 3 20
xxzaffeeeeddfkkkkllq      Sample Output 3 10

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

print(ans)

Solution (Python):
n=int(input())
a=input()
c=[]
pre=''
for x in a:
  if x!=pre:
    c.append(x)
  pre=x
print(len(c))

Solution (Python):
n = int(input())
S = input()

res = 1
tmp = S[0]
for i in range(1,n):
  if S[i] != tmp:
    res += 1
  tmp = S[i]
print(res)

Solution (Python):
n = int(input())
s = input()
ans = 0
pc = ''
for i in s:
    if i != pc:
        ans += 1
    pc = i
print(ans)

Solution (Python):
n = int(input())
s = input()

i = 0
count = 0
while i < n:
  c = s[i]
  while i < n and s[i] == c:
    i += 1
  count += 1
print(count)

Solution (Python):
n = int(input())
s = list(input())

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

print(t)

Solution (Python):
N=int(input())
S=input()
ans=0
p=''
for s in S:
    if s!=p:
        p=s
        ans+=1
print(ans)

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

Solution (Python):
import math
from collections import defaultdict,deque

ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

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

Solution (Python):
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()

Solution (Python):
N = int(input())
S = input()

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

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

Solution (Python):
import itertools as i;N = int(input());print(len([k for k, v in i.groupby(input())]))

Solution (Python):
import itertools;N = int(input());print(len([k for k, v in itertools.groupby(input())]))

Solution (Python):
from itertools import *
N = int(input())
print(len(list(groupby(input()))))

Solution (Python):
input()
S=input()
print(1+sum(S[i]!=S[i+1]for i in range(len(S)-1)))

Solution (Python):
input()
S=input()

l=S[0]
c=1
for i in S[1:]:
 if l!=i:
  c+=1
  l=i
print(c)

Solution (Python):
input()
S=input()

while True:
 x=''
 ans=''
 for i in S:
   if (x==''):
    x=i
    continue
   if x!=i:
    ans+=x
    x=i
 ans+=x
 if ans==S:
   break
 else:
   S=ans
print(len(ans))

Solution (Python):
N=int(input())
S=input()

while True:
    x=''
    ans=''
    for i in S:
       if (x==''):
        x=i
        continue
       if x!=i:
        
        ans+=x
        x=i
        

    ans+=x
    
    if ans==S:
        break
    else:
        S=ans
print(len(ans))

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

Solution (Python):
n = int(input())
s = input()

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

print(ans)

Solution (Python):

N =int(input())
S =str(input())
cnt = 1
moji = S[0]
for i in range(1,N):
    if S[i] != moji:
        cnt += 1
        moji = S[i]

print(cnt)

Solution (Python):
n = int(input())
s = input()

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

Solution (Python):
N = int(input())
S = input()
res = 0

f = S[0]

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

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

Solution (Python):
n = int(input())
s = input()
cur = s[0]
ans = 0



for i in range(1,n):
    if s[i]==cur:
        pass
    else:
        cur = s[i]
        ans+=1
ans+=1
print(ans)

Solution (Python):
N = int(input())
S = input()
S = list(S)

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

Solution (Python):
n = int(input())
S = input()
ls = [S[0]]
for s in S[1:]:
    if ls[-1] == s:
        continue
    ls.append(s)
print(len(ls))

Solution (Python):
N = int(input())
S = input().rstrip()
res = 1
s0 = S[0]
for s in S[1:]:
    if s != s0:
        res += 1
    s0 = s
print(res)

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

Solution (Python):
import sys

inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instr = lambda: sys.stdin.readline()
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
s = instr()

prev = s[0]
ans = 1

for i in range(1,n):
    if s[i] == prev:
        continue
    else:
        prev = s[i]
        ans += 1

print(ans)

Solution (Python):
N=int(input())
S=input()
c=0
for i in range(N-1):
    if S[i]==S[i+1]:
        c+=1
print(N-c)

Solution (Python):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
s = input()
prv = "*"
ans = 0
for i,c in enumerate(s):
    if c!=prv:
        ans += 1
    prv = c
print(ans)

Solution (Python):
N=int(input())
S=list(input())

a=0
for i in range(N-1):
    if not S[i]==S[i+1]:
        a=a+1
print(a+1)

Solution (Python):


def main():

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

    ans = 1

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

    print(ans)


if __name__ == "__main__":
    main()

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

Solution (Python):
n = int(input())
s = input()

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

Solution (Python):
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
n = int(lines.pop(0))
s = lines.pop(0)
count = 0
prev_c = None
for c in s:
    if c != prev_c:
        count += 1
    prev_c = c
print(count)

Solution (Python):
N = int(input())
S = input()

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

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import numpy as np
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

N = I()
S = _S()



last = ''
count = 0
for i in range(N):
    a = S[i]
    if not last == a:
        count += 1
        last = a
print(count)

Solution (Python):
n = int(input())
s = str(input())
s_new = s[0]

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

print(len(s_new))

Solution (Python):


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N = read_int()
    S = input()
    count = 1
    for i in range(1, N):
        if S[i] != S[i-1]:
            count += 1
    return count


if __name__ == '__main__':
    print(solve())

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

Solution (Python):
n = int(input())
s = input()

ans = 1
prev = s[0]
for i in range(1, len(s)):
    if s[i] == prev:
        continue
    ans += 1
    prev = s[i]
print(ans)

Solution (Python):
n = int(input())
s = input()

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

print(cnt)

Solution (Python):
from itertools import groupby
input()
print(len(list(groupby(input()))))

Solution (Python):
n=int(input())
d=input()
ans=""
for i in range(n-1):
    if d[i]!=d[i+1]:
        ans+=d[i]
if d[n-1]!=ans[:-1]:
    ans+=d[n-1]

print(len(ans))

Solution (Python):
n = int(input())
s = input()

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

Solution (Python):
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
import math
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math as M
MOD=10**9+7
import sys

n=int(input())
A=list(input())
X=["0"]
for i in range(n):
    if X[-1]!=A[i]:
        X.append(A[i])
X.pop(0)
print(len(X))

Solution (Python):






















































global FLAG_LOG
FLAG_LOG = False


def log(value):
    
    
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    S = lines[1]
    N = int(lines[0])
    
    
    
    
    
    
    
    
    

    prev = ''
    cnt = 0

    for char in S:
        if prev != char:
            cnt += 1
            prev = char

    return [cnt]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['10', 'aabbbbaaca']
        lines_export = [5]
    if pattern == 2:
        lines_input = ['5', 'aaaaa']
        lines_export = [1]
    if pattern == 3:
        lines_input = ['20', 'xxzaffeeeeddfkkkkllq']
        lines_export = [10]
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode



def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

Solution (Python):
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('_', '')))

Solution (Python):
n = input()
s = input()

slime = s[0]
for index in range(1,len(s)):
  if s[index] != s[index-1]:
    slime += s[index]
print(len(slime))

Solution (Python):
n=int(input());s=input();print(1+sum([s[i-1]!=s[i] for i in range(1,n)]))

Solution (Python):
N=int(input())
S=input()
K=S
i=0
han=S[0]
kot=S[0]

for b in K:
    if b != han:
        kot+=b
        han=b



print(len(kot))

Solution (Python):
from itertools import groupby
n=int(input())
s=input()
print(len(list(groupby(s))))

Solution (Python):
input()
cnt = 0
x = ""
for s in input():
    if x != s:
        cnt += 1
        x = s
print(cnt)

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

Solution (Python):
n = int(input())
s = input()
print(1 + sum(s[i] != s[i + 1] for i in range(n - 1)))

Solution (Python):
N = int(input())
S = input()

ans = 1
for i, s in enumerate(S):
  if i == N-1:
    break
  if s == S[i+1]:
    continue
  else:
    ans += 1

print(ans)

Solution (Python):
n = int(input())


s = input()

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

print(ans)

Solution (Python):
n=int(input())
s=input()

bef=s[0]
ans=1
for i in s[1:]:
  if i !=bef:
    ans+=1
    bef=i
print(ans)

Solution (Python):
N = int(input())
S = list(input())
S.append("test")
i = 0
while N > 0:
    if S[i] == S[i+1]:
        S.pop(i)
        i = i - 1
    i = i + 1
    N = N - 1
print(len(S)-1)

Solution (Python):
from itertools import groupby
N = int(input())
S = input()
g = groupby(S)
print(len(list(g)))

Solution (Python):

import sys
def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w') 

def main(N, arr):

	
	maxi=float("inf")

	
	ans=0

	
	for i in range(N):

		
	    maxi=min(maxi,arr[i])
	    
	    ans+=maxi
	    print("dhh")

    
	return ans
        

if __name__ == '__main__':

	
	'''N = 4

	
	Arr = [4,3,2,1]

	
	answer = main(N,Arr)

	
	print(answer)'''
	n=int(input())
	s=input()

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

Solution (Python):
n=int(input())
s=str(input())
l=[]
for i in range(0,len(s)):
    if(len(l)==0):
        l.append(s[i])
    elif(l[len(l)-1]!=s[i]):
        l.append(s[i])
    else:
        pass
print(len(l))

Solution (Python):
N = int(input())
S = input()

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

Solution (Python):
N = int(input())
S = list(input())
n = 1
for i in range(1,N):
    if S[i] == S[i-1]:
        pass
    else:
        n += 1
print(n)

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

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

Solution (Python):
n = int(input())
s = input()

s = s + '@'
prev = s[0]
ans = 0
for i in range(1, n + 1):
    if s[i] != prev:
        ans += 1
    prev = s[i]
print(ans)

Solution (Python):
n = int(input())
s = input()

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

print(n)

Solution (Python):
def resolve():
    N = int(input())
    S = input()
    ans = 0
    prev = ""
    for c in S:
        if c == prev:
            continue
        ans += 1
        prev = c
    print(ans)

    
if '__main__' == __name__:
    resolve()

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

Solution (Python):
N=int(input())
S=input()

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

Solution (Python):
N = int(input())
S = input()
fus = 0
for i in range(N - 1):
    if S[i] == S[i+1]:
        fus += 1
print(N - fus)

Solution (Python):
n = int(input())

k = input()

final = 0
for i in range(0, n - 1):
    if k[i] != k[i + 1]:
        final += 1
        
print(final + 1)

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

Solution (Python):
n = int(input())
st = input()

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

Solution (Python):
N = int(input())
S = input()

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

print(ans)

Solution (Python):
N = int(input())
S = input()
print(sum(S[i]!=S[i+1] for i in range(N-1))+1)

Solution (Python):



def main():
    N = int(input())
    S = 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()

Solution (Python):
n=int(input())
s=input()
judge=''
for i in range(n):
    if s[i]==judge:
        n-=1
    judge=s[i]

print(n)

Solution (Python):
from itertools import groupby
n = int(input())
s = input()
g = groupby(s)
print(len(list(g)))

Solution (Python):
n = int(input())
s = list(input())

ans = 1
temp = s[0]

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

print(ans)

Solution (Python):
N = int(input())
S = input()
A = []
x = 0

for i in range(N):
    A.append(S[i])

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

print(len(A) - x)

Solution (Python):
n=int(input())
s=input()+'*'
ans=0
for i in range(n):
    if s[i]!=s[i+1]:
        ans+=1
print(ans)

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

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

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

Solution (Python):
def resolve():
    
    N=int(input())
    S=list((input()))
    ans=S[0]

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

    print(len(ans))        


resolve()

Solution (Python):
import sys
input = sys.stdin.readline

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

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

Solution (Python):
from sys import stdin
input = stdin.readline


def main():
  N = int(input())
  S = input()[:-1]

  pre = S[0]
  cnt = 1
  for i in range(1, N):
    if pre == S[i]:
      pre = S[i]
      continue
    cnt += 1
    pre = S[i]
  print(cnt)


if(__name__ == '__main__'):
  main()

Solution (Python):
n = int(input())
s = input()

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

print(ans)

Solution (Python):
n = int(input())
s = input()

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

Solution (Python):
N = int(input())
S = str(input())

ans = ""
ans += S[0]

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

Solution (Python):
n=int(input())
s=input()
a=[]
for i in range(n):
    if i==n-1:
        a.append(s[i])
        continue
    if s[i]!=s[i+1]:
        a.append(s[i])
print(len(a))

Solution (Python):
n = int(input())
s = input()
i = 0
while i < len(s)-1:
    if s[i] == s[i+1]:
        s = s[:i] + s[i+1:]
        i -= 1
    i += 1
print(len(s))

Solution (Python):
N=int(input())
S=input()
res=[S[0]]
for i in range(N-1):
  if(S[i]!=S[i+1]):
    res.append(S[i+1])
print(len(res))

Solution (Python):
N = int(input())
S = list(''.join(input()))

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

Solution (Python):
import sys
readline = sys.stdin.readline

N = int(readline())
S = readline().rstrip()

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

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

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

Solution (Python):
n = int(input())
s = input()
fusion =[]
tmp = s[0]
fusion.append(tmp)
for i in s[1:]:
    if i != tmp:
        tmp = i
        fusion.append(i)
print(len(fusion))

Solution (Python):
N = int(input())
S = list(input())

while(True):
    count = 0
    for i in range(len(S) - 1, 0, -1):
        if S[i] == S[i-1]:
            S.pop(i)
            count += 1
    if count == 0: break
print(len(S))

Solution (Python):
import itertools
a=int(input())
b=input()

list2 = [k for k, v in itertools.groupby(b)]
print(len(list2))

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

Solution (Python):
N=int(input())
S=input()
last = S[0]
cnt = 1
for s in S[1:]:
  if last != s:
    cnt+=1
    last = s
print(cnt)

Solution (Python):
n=int(input())
s=input()

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

Solution (Python):
N = int(input())
S = input()

cnt = 1
last = S[0]
for s in S:
    if last == s:
        continue
    else:
        cnt += 1
        last = s
print(cnt)

Solution (Python):
import sys




from collections import deque


import bisect
import math

def input():
    return sys.stdin.readline().rstrip()


def main():
    N =int(input())
    S = input()
    pre ="A"
    count=0
    for i in S:
        if i !=pre:
            count+=1
        pre = i
    print(count)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
s = input()

c_curr = ""
ans = 0
for c in s:
    if c != c_curr:
        ans += 1
        c_curr = c
print(ans)

Solution (Python):
import re

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

result = ''

for i in range(len(S)):
    if i == len(S) - 1:
        result += S[i]
    elif S[i] != S[i+1]:
        result += S[i]

print(len(result))

Solution (Python):
from sys import stdin,stdout

if __name__=="__main__":

    n=int(stdin.readline())

    s=str(input())

    l=s[0]
    cnt=1

    for i in range(1,len(s)):
        if(s[i]!=l):
            cnt+=1
            l=s[i]

    stdout.write(str(cnt)+"\n")

Solution (Python):








def solve(N, S):
    fusioned = S[0]
    for s in S:
        if fusioned[-1] != s:
            fusioned += s
    print(len(fusioned))


if __name__ == '__main__':
    N = int(input())
    S = input()
    solve(N, S)

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0
inf = float("inf")

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

print(count+1)

Solution (Python):

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

if __name__ == "__main__":
    N = int(input())
    S = input()
    solve()

Solution (Python):
input()
S = input()
j = ""
A =""
for i in S:
    if i !=j:
        A += i
        j = i
print(len(A))

Solution (Python):
n = int(input())
s = input()

ans = 0
prev = ''
for si in s:
    if prev == si:
        continue
    ans += 1
    prev = si

print(ans)

Solution (Python):
N = int(input())
S = input()

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

Solution (Python):
n = int(input())
s = list(input())
slime = []
for i in range(n-1):
	if s[i] != s[i+1]:
		slime.append(s[i+1])
print(len(slime)+1)

Solution (Python):
n = int(input())
s = input()
t = 1

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

print(t)

Solution (Python):
def main():
    n = int(input())
    s = input()
    ans = 0
    for i in range(n):
        if i == 0:
            ans += 1
            mae = s[i]
        else:
            if s[i] != mae:
                ans += 1
                mae = s[i]
    print(ans)


    
if __name__ == "__main__":
    main()

Solution (Python):
import sys

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

if n == 1:
    print(1)
    sys.exit()

a = []

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

if len(a) == 0:
    print(1)
else:
    if a[-1] != s[-1]:
        a.append(s[-1])

    print(len(a))

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

Solution (Python):
def main():
    N = int(input())
    S = input().rstrip()
    current_char = S[0]
    ans = 1
    for idx in range(1, N):
        if S[idx] != current_char:
            ans += 1
            current_char = S[idx]
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
s = list(input())
b = 0
d = s[0]
for i in range(n):
    if d != s[i]:
        d = s[i]
        b += 1

print(b+1)

Solution (Python):
n = int(input())
s = input()

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

Solution (Python):
n=input()
s = input()
cnt=0
s_list = [word for word in s]

tmp = s_list.pop()
for _ in range(len(s_list)):
  tmp_2 = s_list.pop()
  if tmp!=tmp_2:
    cnt+=1
  tmp=tmp_2
print(cnt+1)

Solution (Python):
n = int(input())

s = input()
ans = [s[0]]
for i in range(1,n):
    if ans[-1] != s[i] :
        ans.append(s[i])

print(len(ans))

Solution (Python):
input()
s = input()
count = 1
for i in range(len(s)-1):
    if s[i]!=s[i+1]:
        count+=1
print(count)

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

Solution (Python):


import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**6)
INF = float("inf")

def main():
    N = int(input())
    S = input()

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

    print(ans)
    
if __name__ == "__main__":
    main()

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

Solution (Python):
N = int(input())
S = input()

counter = 0
past = S[0]
for s in S[1:]:
    
    if not s==past:
        counter += 1
        past = s
    
print(counter+1)

Solution (Python):
n = int(input())
s = input()

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

Solution (Python):
N = int(input())
S = list(input())

cnt = 1
tmp = S[0]
for k in range(1, N):
  if not S[k] == tmp:
    cnt += 1
  tmp = S[k]
print(cnt)

Solution (Python):

n,s = open(0).read().split()
print(1+sum(s[i-1]!=s[i] for i in range(1,int(n))))

Solution (Python):
n = int(input())
s = input()

count = 1
i = 0

while i < n-1:
    if s[i] == s[i+1]:
        i += 1

    else:
        count += 1
        i += 1

print(count)

Solution (Python):
N = int(input())
S = input()

slime = S[0]

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

print(len(slime))

Solution (Python):
n=int(input())
s=list(input())
ans=0
i=0
while i+1<n:
  j=0
  while s[i+j]==s[i+j+1]:
    if i+j+1<=n-2:
      j+=1
    else:
      j+=1
      break
  i+=j+1
  ans+=j
  
print(n-ans)

Solution (Python):
n = int(input())
S = input()
beforeChara = ""
cnt = 0
for s in S:
    if s != beforeChara:
        cnt += 1
    beforeChara = s
print(cnt)

Solution (Python):
n=int(input())
s=input()

ans=1
last=s[0]

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

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

Solution (Python):
n=int(input())
s=input()
a=[s[0]]
for i in range(1,n):
  if s[i]!=s[i-1]:
    a.append(s[i])
"".join(a)
print(len(a))

Solution (Python):
N=int(input())
S=list(input())
if N == 1:
  print(1)
if N>=2:
  if S[0] == S[1]:
    S[0]==" "
  for i in range(1,N):
    if S[i-1]==S[i]:
      S[i-1]=" "
  A=[]
  for i in range(N):
        if S[i]!=" ":
              A.append(S[i])
  print(len(A))

Solution (Python):
N = int(input())
S = input()

ans = 0
p = S[0]
for i in range(1, N):
    if S[i] == p:  continue
    else:
        ans += 1
        p = S[i]
print(ans + 1)

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

Solution (Python):
n = int(input())
s = input()

cnt = 1

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

Solution (Python):
N = int(input())
S = input()

s = S[0]
cnt = 1

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

Solution (Python):
n=int(input())
s=list(input())

for x in range(n-1):
  if s[x]==s[x+1]:
    s[x]='1'
    
print(len(s)-s.count('1'))

Solution (Python):
N = int(input())
S = input()

s = [S[0]]
for i in range(1,N):
    if S[i] != S[i-1]:
        s.append(S[i])

print(len(s))

Solution (Python):
n = int(input())
s = input()
temp = s[0]
ans = 1
for a in s:
  if temp!=a:
    temp = a
    ans += 1
print(ans)

Solution (Python):
n = input()
n = input()
cnt = 0
a = n[0]
for i in range(1,len(n)):
    if a == n[i]:
        continue
    else:
        cnt += 1
        a = n[i]
print(cnt + 1)

Solution (Python):

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

print(len(ans) - 1)

Solution (Python):
import sys


from collections import defaultdict, Counter
inp = sys.stdin.readline
read = lambda: list(map(int, inp().strip().split()))





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


		

if __name__ == "__main__":
	solve()

Solution (Python):
N = int(input())
S = list(input())
check = S[0]
count =1
for i in range(1,N):
    if(check!=S[i]):
        check=S[i]
        count +=1
print(count)

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

Solution (Python):
N=int(input())
S=input()
ans=1
for i in range(len(S)-1):
    if S[i]==S[i+1]:
        pass
    else:
        ans+=1
print(ans)

Solution (Python):
n= int(input())
s = input()
ans = 1
prev = s[0]
for i in range(n-1):
    if prev==s[i+1]:
        pass
    else:
        ans += 1
        prev = s[i + 1]

print(ans)

Solution (Python):
n= int(input())
s = input()
ans = 1
for i in range(n-1):
    if s[i]==s[i+1]:
        continue
    else:
        ans += 1

print(ans)

Solution (Python):
n= int(input())
s = input()
ans = 1
for i in range(n-1):
    if s[i]==s[i+1]:
        pass
    else:
        ans += 1

print(ans)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = int(readline())
    S = readline().strip()

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

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
S = input()
Count = 1
for T in range(0,N-1):
    if S[T]!=S[T+1]:
        Count += 1
print(Count)

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

Solution (Python):
def main():
    n = int(input())
    s = list(input())
    cnt = 1
    for i in range(1, n):
        if s[i] == s[i-1]:
            continue
        else:
            cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
s=list(input())
mylist=[s[0]]
for i in range(1,n):
    if s[i-1]!=s[i]:
        mylist.append(s[i])
print(len(mylist))

Solution (Python):
n = int(input())
s = input()

ans = 0
prev = ''
for si in s:
    if prev == si:
        continue
    else:
        ans += 1
        prev = si

print(ans)

Solution (Python):
N=int(input())
S=input()

S=list(S)

ans=[]
color = ''
for s in S:
    if color != s:
        ans.append(s)
        color = s
print(len(ans))

Solution (Python):
n = int(input())
s = input()
sl = list(s)
k = 0
cur = '0'
for i in range(n):
    if sl[i] == cur:
        continue
    else:
        k += 1
        cur = sl[i]
print(k)