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=input()
n=0
for i in range(N-1):
  if S[i]==S[i+1]:
    n+=1
print(N-n)

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

if __name__ == '__main__':
    main()

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()
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()

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

print(int(N))

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

i = 0
leght = n
result = list(colors[0])

for i in range(n-1):
  if colors[i] != colors[i+1]:
  	result.append(colors[i+1])
    
print(len(result))

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):
def main():
    n = input()
    slimes = list(input())

    one = 0
    count = 0
    for slime in slimes:
        if one != slime:
            count+=1
        one = slime
    print(count)
if __name__ == "__main__":
    main()

Solution (Python):
def main():
    n = input()
    slimes = list(input())
    cnt = 1
    for i in range(len(slimes)-1):
        if slimes[i] != slimes[i+1]:
            cnt+=1

    print(cnt)


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    n = input()
    slimes = list(input())
    cnt = 1
    for i in range(len(slimes)-1):
        if slimes[i] != slimes[i+1]:
            cnt+=1

    print(cnt)


if __name__ == "__main__":
    main()

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

Solution (Python):
le = int(input())
lis = list(input())
alis = []
def delete(n,lis):
    for i in range(n):
        if i==n-1 or lis[i] != lis[i+1]  :
            alis.append(lis[i])
delete(le,lis)
print(len(alis))

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

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

print(len(S)-check)

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

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

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

print(len(S)-check)

Solution (Python):
N=int(input())
S=list(input())
check=[]
for i in range(N-1):
  if S[i]==S[i+1]:
    check.append(i)
check=reversed(check)
for i in check:
  S.pop(i)
print(len(S))

Solution (Python):
N = int(input())
S = input()
char = list(S)
count = 0

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

print(count + 1)

Solution (Python):
def main(n,s):
    if n == 1:
        return 1
        
    count = 1
    for i in range(1,n):
        if s[i] != s[i-1]:
            count += 1
    return count

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


print(main(n,s))

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

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())
a = input()
ans = 1
for i in range(1, n):
    if a[i] != a[i - 1]:
        ans += 1
print(ans)

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

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

s = []
tmp = "temp"
for i in S:
    if tmp != i:
        s.append(i)
        tmp = i
    else: continue

print(len(s))

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

s_list = list(s)
counter = 0
for m in range(1,len(s_list)):
  if s_list[m] == s_list[m-1]:
     counter += 1
print(len(s_list) - counter)

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):
from sys import stdin
n = int(stdin.readline().rstrip())
s = [x for x in stdin.readline().rstrip()]
a = 0
for i in range(len(s)):
    if not i == len(s) - 1:
        if s[i] == s[i+1]:
            a += 1
print(n-a)

Solution (Python):
def main():
    n = int(input())
    S = list(input())

    count = 0
    for i in range(len(S)-1):
        if S[i] == S[i+1]:
            count += 1
    print(n-count)


if __name__ == '__main__':
    main()

Solution (Python):
def into_lan(s,n):
	ch = s[0]
	res = 0
	for i in range(1,n):
		if(s[i] != ch):
			res = res + 1
		ch = s[i]
	return res + 1

n = int(input())
body = input()
print(into_lan(body,n))

Solution (Python):

from itertools import groupby


def main():
    N = int(input())
    S = input().rstrip()
    ans = len(tuple(groupby(S)))
    print(ans)


if __name__ == "__main__":
    main()

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):
N = int(input())
S = input()
count = 1
for i in range(1,N):
    if S[i] != S[i-1]:
        count += 1
print(count)

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

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

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

print(ans + 1)

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

p=[]

for i in range(n-1):
  if s[i]==s[i+1]:
    p.append(i)
p.sort(reverse=True)
l=len(p)

for i in range(l):
    
    s.pop(p[i])

print(len(s))

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

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

Solution (Python):
n = int(input())
s = str(input())
ans = [s[0]]
for letter in s:
    if letter != ans[-1]:
        ans += letter
    else:
        continue
print(len(ans))

Solution (Python):

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

ret = s[0]
cur_col = s[0]
for i in s:
    if i != cur_col:
        cur_col = i
        ret += i

print(len(ret))

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

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

print(n)

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

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

Solution (Python):
N = input()
re = [str(x) for x in input()]
s = [re[0]]
for n in range(len(re)-1):
  if not re[n] == re[n+1]:
    s.append(re[n+1])
  t = re[n+1]
print(len(s))

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()

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

Solution (Python):
def T():
    N=int(input())
    c=''
    for s in input():
        if s==c:
            N-=1
        c=s
    return(N)
print(T())

Solution (Python):
def T():
    N=int(input())
    c=''
    t=0
    for s in input():
        if s==c:
            N-=1
        c=s
    return(N)
print(T())

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

Solution (Python):


n = int(input().rstrip())
l = list(input().rstrip())
count = i = 0

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

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):
length = int(input())
list = list(input())

counter = 0

for k in range(length-1):
    try:
        while True:
            if list[k] != list[k+1]:
                break
            list.pop(k+1)
    except:
        break


print(len(list))

Solution (Python):
m=input()
A=int(m)
n=input()
list =[]
sum = 1
for i in range(0,A):
    list.append(n[i])
    if (i!=0) & (list[i-1]!=list[i]):
        sum = sum+1
print(sum)

Solution (Python):

import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    n = int(input())
    s = input()
    ans = 1

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

if __name__ == '__main__':
    main()

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

sum = 0

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

print(N - sum)

Solution (Python):
n = int(input())
str = input()
char_list = list(str)


count =0
ans =0


for i in range(len(char_list)-1):
    if char_list[i] == char_list[i+1]:
        
        count += 1

ans = n - count

print(ans)

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

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

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

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):
a = int(input())
s = input()
last = ''
counter = 0
for slime in s:
  if last != slime:
    counter += 1
    last = slime
print('{}'.format(counter))

Solution (Python):
input()
slimes = input()
res = slimes[0]
slimes = slimes[1:]
for i in slimes:
  if res[-1] != i:
     res += i
print(len(res))

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

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

Solution (Python):
slime_num = int(input())
color_str = input()
ans = 0
pre_color = "aa"
same_color_check = 0
for i in color_str:
    if not same_color_check:
        if i == pre_color:
            same_color_check = 1
        else:
            ans += 1
            pre_color = i
    else:
        if i != pre_color:
            same_color_check = 0
            pre_color = i
            ans += 1
print(ans)

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

print(s)

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

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

print(ans)

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

ans = 0
x = 'xxxxxxxx'
for s in S:
    if s != x:
        ans += 1
    x = s

print(ans)

Solution (Python):
import itertools
N = int(input())
x = list(input())

ct = 1
j = x[0]
for i in x:
    if(i != j):
        ct += 1
    j = i

print(ct)

Solution (Python):
def func():
    N = int(input())
    r = 0
    S = ''
    for s in list(input()):
        if S != s:
            r += 1
            S = s
    return r
print(func())

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


L=N
for j in range(N-1):
  if S[j]==S[j+1]:
    L -=1
    
print(L)

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

ans = list(S[0])
prev = S[0]

for c in S[1:]:
    if prev != c:
        ans.append(c)
    prev = c

print(len(ans))

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

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

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

c = 0
r = ''
for x in s:
    if x != r:
        c += 1
    r = x

print(c)

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(1000000000)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    N=ii()
    S=input()
    ans=[S[0]]    
    t=S[0]
    for i in range(1,len(S)):
        if S[i]!=t:
            t=S[i]
            ans.append(t)
    print(len(ans))
if __name__ == "__main__":
    main()

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

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

Solution (Python):
N = int(input())
l = list(input())
r = 0
for i, s in enumerate(l):
    if i + 1 == N:
        r += 1
        print(r)
        break
    if s != l[i + 1]:
        r += 1

Solution (Python):

n = int(input())
s = input()
ans = ""
temp = s[0]

for i in s[1:]:
    if temp != i:
        ans += temp
        temp = i

print(len(ans)+1)

Solution (Python):
N = int(input())
l = list(input())
h = []
for i, s in enumerate(l):
    if i + 1 == N:
        h.append(s)
        print(len(h))
        break
    if s != l[i + 1]:
        h.append(s)

Solution (Python):
length = int(input())
li = list(input())
li2 = []
for i, str in enumerate(li):
    if i + 1 == length:
        li2.append(str)
        print(len(li2))
        break
    if str != li[i + 1]:
        li2.append(str)
        continue

Solution (Python):
length = int(input())
li = list(input())
li2 = []
i = -1
for str in li[:]:
    i = 1 + i
    if i + 1 == len(li):
        li2.append(li[i])
        print(len(li2))
        break
    if li[i] != li[i + 1]:
        li2.append(li[i])
        continue

Solution (Python):
length = int(input())
li = list(input())
i = 0
for n in li[:]:
    if i + 1 == len(li):
        print(len(li))
        break
    if li[i] == li[i + 1]:
       del (li[i + 1])
    else:
        i = 1 + i
        continue

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

prev = None

cnt = 0
for v in s:
    if prev != v:
        cnt += 1
    prev = v
print(cnt)

Solution (Python):
words = lambda t : list(map(t, input().split()))
n = int(input())
s = input()
prev = s[0]
ans = 1
for c in s:
    if prev != c:
        ans += 1
        prev = c

print(ans)

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

S_list = list(S)

num_slime = 1

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

print(num_slime)

Solution (Python):
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
import itertools
import math
INF = 10**9
MOD = 10**9+7

N = int(input())
S = input()
S += '0'
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
for i in range(1,n):
    if(s[i] != s[i-1]):
        ans+=1
print(ans)

Solution (Python):
import numpy as np
from collections import defaultdict
from functools import reduce

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

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

print(res)

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

print(n - count)

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

Solution (Python):
import re

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

t = re.sub(r'(.)\1{1,}', 'X', S)
print(len(t))

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

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

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

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

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

Solution (Python):
N = int(input())
S = input()
slimes = []
for i in S:
	slimes.append(i)



def yugou(slimes):
	temp = []
	for i in range(len(slimes)-1):
		if slimes[i] != slimes[i+1]:
			temp.append(slimes[i])
	temp.append(slimes[-1])
	return(temp)


def f(x):
	y = yugou(x)
	if x == y:
  		ans = y
	else:
		y = f(x)
	return(ans)

temp_ans = yugou(slimes)
if temp_ans == slimes:
	ans=temp_ans
else:
	ans = f(temp_ans)

print(len(ans))

Solution (Python):
n = int(input())
s = input()
list_s = []
for i in range(n):
    list_s.append(s[i])

for i in range(n):
    try:
        while list_s[i] == list_s[i+1]:
            if list_s[i] == list_s[i+1]:
                list_s.pop(i+1)
    except IndexError:
        continue
print(len(list_s))

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

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

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

out = ""
i = 0
while True:
    end = False
    if i == N-1:
        out += S[i]
        break
    for j in range(i+1, N):
        if S[i] == S[j]:
            end = True
            continue
        else:
            out += S[i]
            i = j
    if end:
        out += S[i]
        break

print(len(out))

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

remain = [c for i,c in enumerate(s) if (i==0)|(s[i-1]!=c)]

print(len(remain))

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

Solution (Python):
def main():
    n, s = open(0).read().split()
    n = int(n)

    before_s = ''
    ans = 0
    for _s in s:
        if _s != before_s:
            ans += 1
            before_s = _s
        else:
            continue
    print(ans)
    return()

if __name__ == '__main__':
    main()

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


if __name__ == "__main__":
    main()

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()
l=[]
c=0
l.append(s[0])
for i in range(1,n):
  if(s[i]!=l[c]):
    c+=1
    l.append(s[i])    
print(c+1)

Solution (Python):




import sys

readline = sys.stdin.readline 

n = int(input())

s = input()

from itertools import groupby

ans = 0
for i in groupby(s):
    ans += 1


print(ans)

Solution (Python):
a= input()

N=int(a[0])


d=str(input())

check=d[0]
res=[]
res.append(d[0])

for i in range(len(d)):
  if check != d[i]:
    res.append(d[i])
    check=d[i]
    
print(len(res))

Solution (Python):
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    s = str(input().rstrip('\n'))
    cnt = 0
    for i in range(1, n):
        if s[i] != s[i-1]:
            cnt += 1
    print(cnt+1)


if __name__ == '__main__':
    solve()

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

Solution (Python):
n = int(input())
s = input()
try:
    ch = s[0]
except :
    pass
su = 1
for c in range(1, n):
    if ch == s[c]:
        continue
    else:
        ch = s[c]
        su += 1

print(su)

Solution (Python):
n=int(input())
s=str(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 = list(input())
r = S[0]
cnt = 0
for i in range(1, n):
  if S[i] != r:
    r = S[i]
  else:
    cnt += 1
print(n-cnt)

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

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

Solution (Python):
n = int(input())
s = str(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()
for i in range(N-1):
    if S[i]==S[i+1]:
        N-=1
print(N)

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

counter=1

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

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):
import re
 
N = int(input())
S = input()
 
s = 0
a = 1
while s<len(S):
    pattern = re.compile(r"[^%s]+?" % S[s])
    matchObj = re.search(pattern, S[s+1:])
    if matchObj:
        s += matchObj.start()+len(matchObj.group())
        a+=1
    else:
        break
print(a)

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

Solution (Python):
n = int(input())
s = input()
a = [str(c) for c in s]
total=1

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

print(total)

Solution (Python):
_,s=open(0)

sl=list(s)

n=len(sl)

i=int(0)

while i<n-1:
    if sl[i]==sl[i+1]:
        sl[i]="rep"
        i+=1
    else:
        i+=1



print(len([j for j in sl if j!="rep"])-1)

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

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

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

print(cnt)

Solution (Python):
from itertools import groupby


def main():
    S = open(0).read().split()[1]
    print(sum(1 for x in groupby(S)))


main()

Solution (Python):
from itertools import groupby


def main():
    S = open(0).read().split()[1]
    print(len(list(groupby(S))))


main()

Solution (Python):
N = int(input())
S = list(input())
def app(S):
  for i in range(1,len(S)):
    if S[i] == S[i-1]:
      S[i] = ''
  S = [S[i] for i in range(len(S)) if S[i]!='']
  return S
while app(S) != S:
  S = app(S)
print(len(S))

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

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

pp = "
res = 0
for s in S:
	if s != pp:
		res += 1
	pp = s

print(res)

Solution (Python):
N = int(input())
S = input()
sum = 0
temp= ""

for i in list(S):
    if temp != i:
        temp = i
        sum+=1

print(sum)

Solution (Python):
n = int(input())
s = str(input())
result = ''
before = ''
count = 0
for i in range(len(s)):
    current = s[i]
    if current != before:
        result += current
        count += 1
    before = current
print(count)

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

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

    targets = input()
    ans = 1

    for i in range(len(targets)-1):
        if targets[i] == targets[i+1]:
            pass
        else:
            ans += 1

    print(ans)
resolve()

Solution (Python):
N=int(input())
S=input()
count = 0
ans=0
j=''

for i in S:
    count +=1
    if (count>=2) & (i==j): continue
    else:
        j=i
        ans += 1

print(ans)

Solution (Python):

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

c = s[0:1]
x = 1

for i in range(1,len(s)):
    
    if s[i:i+1] != c:
        x = x + 1
        c = s[i:i+1]
print(x)

Solution (Python):
N=int(input())
S=input()
S_list=[]
count = 0
j=''

for i in S:
    count +=1
    if (count>=2) & (i==j): continue
    else:
        S_list.append(i)
        j=i

print(len(S_list))

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

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

Solution (Python):
import sys
N = int(sys.stdin.readline())
S = sys.stdin.readline()

ans = 1

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

Solution (Python):
N = int(input())
S = input()
i = 0
count = 0
now_char = None
while i != N:
  if S[i] != now_char:
    now_char = S[i]
    count += 1
  i += 1
print(count)

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:]
        continue
    i = i + 1 
print(len(S))

Solution (Python):
N = int(input())
S = list(input()) + ['end']
cnt = 0

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

Solution (Python):
N = int(input())
S = list(input())
start = 0
intervals = [S[0]]

for i in range(1, N):
    if S[start] != S[i]:
        intervals.append(S[i])
    start = i
print(len(intervals))

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

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())
x = list(input())
for i in range(len(x)-1):
  if x[i] == x[i+1]:
    x[i] = ''
print(len(''.join(x)))

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

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

print(N-sum_)

Solution (Python):
import itertools as i
_,S=open(0)
print(len(list(i.groupby(S)))-1)

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

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

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

Solution (Python):
a=None
count=0
roop=int(input())
li = list(input())
for i in range(roop):
  if li[i]!=a:
    count+=1
    a=li[i]
print(count)

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

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

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

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


if __name__ == "__main__":
    main()

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

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

ans = n

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

print(ans)

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

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

temp = s[0]
i = 1
while i < len(s):
  if s[i] == temp:
    s = s[:i] + s[i+1:]
  else:
    temp = s[i]
    i += 1
    
print(len(s))

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

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

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

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

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

cnt = 0
prev = slimes.pop(0)
while slimes != []:
    curr = slimes.pop(0)
    if prev != curr:
        cnt += 1
    prev = curr

print(cnt+1)

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

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

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

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

forcuss = 0
j = 1
number = 1

while j != N:
    if S[forcuss] == S[j]:
        j = j + 1
        continue
    elif S[forcuss] != S[j]:
        number = number + 1
        forcuss = j
        j = forcuss + 1

print(number)

Solution (Python):
n = int(input())
s = str(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()
count = 0
b = " "
for i in range(N):
	    
    if b != S[i]:
        count = count + 1
        b = S[i]

print(count)

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

lc = s[0]
cnt = 1
for c in s:
    if lc == c: pass
    else:
        lc = c
        cnt += 1

print(cnt)

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

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

count = 1
color = s[0]

for slime in s:
    if color != slime:
        count += 1
        color = slime

print(count)

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

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

        if i == N-1:
            ans += 1

print(ans)

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

Solution (Python):


def next_int():
    return int(input())

def next_ints():
    return list(map(int, input().split()))
n = next_int()
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=list(input())

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

Solution (Python):
N = int(input());S = list(input());print(len([(x,i) for i,x in enumerate(S) if i != N-1 if x != S[i+1]])+1)

Solution (Python):
def main():    
    n = int(input())
    s = input()
    ans = 0
    q2 = ''

    for i in s:
        q1 = i
        if q1 != q2:
            ans += 1
            q2 = q1
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
from collections import deque

def main():    
    n = int(input())
    s = input()

    que = deque(s)
    ans = 0
    q2 = ''

    while len(que)>0:
        q1 = que.popleft()
        if q1 == q2:
            continue
        else:
            ans += 1
            q2 = q1
    print(ans)

if __name__ == '__main__':
    main()

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

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

Solution (Python):

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

ans = 1

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