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):
def main():

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

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

if __name__ == "__main__":
    main()

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

pre=0
counter=0
for slm in d:
    if(pre != slm):
        counter +=1
    pre = slm
print(counter)

Solution (Python):
n = int(input())
s = list(input())
ans = 1
start = s[0]
if n == 1:
    print(1)
else:
    for w in s[1:]:
        if w == start:
            continue
        else:
            ans += 1
            start = w
    print(ans)

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

Solution (Python):
n = int(input())
s = ["0"] + list(input())
ans = 0

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

print(ans)

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

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

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

Solution (Python):
num = int(input())
letters = input()
count = 0
color = ''
for i in letters:
  if color != i:
    count += 1
  color = i
print(count)

Solution (Python):
def solve(string):
    n, s = string.split()
    return str(int(n) - sum([1 for d1, d2 in zip(s, s[1:]) if d1 == d2]))


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

Solution (Python):
from itertools import groupby


def solve(string):
    n, s = string.split()
    return str(len(list(groupby(s))))


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

Solution (Python):
N = int(input())
S = input()
ans = 1
for i in range(N):
  if i <= len(S)-2:
    if S[i] !=S[i+1]:
      ans = 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()
L = len(S)
ans = 1
for i in range(L):
    if i==0:
        continue
    if S[i] == S[i-1]:
        continue
    else:
        ans+=1
print(ans)

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

ans = 1

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

print(ans)

Solution (Python):


n = int(input())

d = input()

s = []
for i in range(n):
    if ((len(s) > 0 and d[i] != s[len(s)-1]) or (len(s) == 0)):
        s.append(d[i])
print(len(s))

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

Solution (Python):
from itertools import groupby 

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

print(sum([ 1 for x in groupby(S)]))

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

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

Solution (Python):
N=int(input())
slimes = []
all_slime=input()
slimes.append(all_slime[0])
lastColor = all_slime[0]
for i in range(1,N):
    new_slime = all_slime[i]
    if not lastColor == new_slime:
        slimes.append(new_slime)
    lastColor=new_slime
print(len(slimes))

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

N=int(input())
S = input().split()
S = list(S[0])
ans=[]
ans.append(S[0])
for i in range(1,N):
    if ans[-1]!=S[i]:
        ans.append(S[i])

print(len(ans))

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

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

Solution (Python):



from collections import deque

N = int(input())
S = deque(input())
A = []
ctr = 0

for i in range(N):
    tmp = S.popleft()
    if A == [] or A[-1] != tmp:
        ctr += 1
    A.append(tmp)
print(ctr)

Solution (Python):
n = int(input())
s = input()
cnt = 0
a = None

for i in s:
	if a != i:
		cnt+=1
		a = i
	else:
		pass
print(cnt)

Solution (Python):
X=int(input())
Y = input()
r=""
a=0
for i in Y:
  if r!=i:
    r=i
    a+=1
print(a)

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

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

print(ans)

Solution (Python):

N = int(input())
foo = ""
ans = 0
for i in input():
    if foo != i:
        ans += 1
    foo = i
print(ans)

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

slime=slime_list[0]
count=1
for s in slime_list:
 if (s!=slime):
  count+=1
  slime=s
 else:
  continue

print(count)

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

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

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

print(c)

Solution (Python):
row = int(input())
data = list(str(input()))

def checker(big,end,index):
	if big == end:
		return 1
	else :
		return 2

resp = []
for var in range(1,row):
	if checker(data[var-1],data[var],var) == 1:
		resp.append(var)
	else:
		pass

resp.reverse()

for deldex in resp:
	del data[deldex]
	

print(len(data))

Solution (Python):
N = int(input())
S = [s for s in input()]

for i, str in enumerate(S):
  while True:
    if i != len(S)-1:
      next = S[i+1]
      if str == next:
        S.pop(i+1)
      else:
        break
    else:
      break
print(len(S))

Solution (Python):
input()
s = list(input())
ans = 1

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

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

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

print(ans)

Solution (Python):
n = input();n = int(n)
a = input() + '
s = a[0]
b = 0
for i in range(1,n+1):
  if s != a[i]:
    b += 1
    s = a[i]
print(b)

Solution (Python):
N=int(input())
S=input()
ANS=list('')
BF = ''
for s in S:
  if BF != s:
    ANS.append(s)
    BF = s
print(len(ANS))

Solution (Python):

N = input()
S = input()

ans = 1
left = S[0]
for s in S:
    if not s == left:
        ans += 1
        left = s


print(ans)

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

s = input().strip()
print(remove_duplicate(s))

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):
n = int(input())
str_list = input()

stert = str_list[0]
count = 1
for i in range(1,n):
  if stert == str_list[i]:
    pass
  else:
    stert = str_list[i]
    count+=1
print(count)

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

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

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

print(ans)

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

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())

N=II()
s=input()
last = ""
cnt = 0
for i in range(N):
    if last != s[i]:
        cnt += 1
        last = s[i]

print(cnt)

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

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=list(s)
l=[]
l.append(s[0])
j=0
for i in range(1,len(s)):
  if l[j]==s[i]:
    continue
  else:
    l.append(s[i])
    j+=1
print(len(l))

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

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):
import sys
input = sys.stdin.readline


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

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

if __name__ == '__main__':
    main()

Solution (Python):
_ = int(input())
s = list(input())
l = []
w = ''
for i in s:
    if w == i:
        pass
    else:
        l.append(i)
        w = i
print(len(l))

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

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

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

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

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 = input()
S = list(input())
count = 1
current = S[0]
for char in S:
    if char != current:
        count += 1
    current = char
print(count)

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

ret = 1
prev = S[0]
for i in range(1, len(S)):
    if S[i] != prev:
        ret += 1
        prev = S[i]
print(ret)

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

ans = 1

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

print(ans)

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

prev = S[0]
c = 1
for s in S :
    if (prev != s) :
        prev = s
        c += 1

print(c)

Solution (Python):
N = int(input())
S = input()
pre = 'Z'
ans = 0
for c in S:
    if c != pre:
        ans += 1
    pre = c

print(ans)

Solution (Python):


 
N = int(input())
s= list(input())
 
s0 = s.pop()
 
cnt = 1
 
while s:
    s1 = s.pop()
    if s1!=s0:
        cnt += 1
        s0 = s1
print(cnt)

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

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random
 




 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    S = input()
    
    ans = 0
    kako = ""
    for i,val in enumerate(S):
        if i == 0:
            ans += 1
            kako = val
            continue
        
        if val != kako:
            ans += 1
            kako = val
    
    print(ans)
    
if __name__ == "__main__":
	main()

Solution (Python):


import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

N = I()
S = input()

ans = 0

tmp = "
for s in S:
    if s != tmp:
        ans += 1
        tmp = s

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_word = list(input())
start_w = s_word[0]
goal_num = 0
for i in range(n-1):
    if s_word[i+1] != start_w:
        start_w = s_word[i+1]
        goal_num += 1
goal_num +=1
print(goal_num)

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

Solution (Python):
N = int(input())
Slime = list(input())
check = Slime[0]
res = 0

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

print(res)

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

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

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

n = int(input())
s = input()
print(solve(n, s))

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

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

count = 0
tmp = ""

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

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

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

ans = 0
prev = ''

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

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

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

pre_color = list(S)[0]
count = 1
for i in list(S):
  if pre_color != i:
    pre_color = i
    count += 1

print(count)

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

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

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

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

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

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

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 = list(input())
sum = 0
prev = "0"
for i in S:
  if prev != i:
    sum += 1
  prev = i
print(sum)

Solution (Python):
n = int(input())
s = list(input())
count = 1
s0 = s.pop(0)
for i in s:
    if s0 != i:
        count += 1
        s0 = i

print(count)

Solution (Python):
n=int(input())
S=str(input())
s=list(S)
i=1
while True:
    if i >= n:
        break
    if s[i-1]==s[i]:
        s.pop(i)
        n -= 1
    else:
        i +=1

print(len(s))

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

res = 1
for i in range(len(S)-1):
    if i == len(S) - 2:
        if S[i] != S[i+1]:
            res += 1
    else:
        if S[i] != S[i+1]:
            res += 1

print(res)

Solution (Python):
n=int(input())
S=str(input())
s=list(S)
i=1
while True:
    if n ==1 or n==0:
        break
    if s[i-1]==s[i]:
        s.pop(i)
        n -= 1
    else:
        i +=1
    if i >= n:
        break
print(len(s))

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

p=''
ans=0

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

print(ans)

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

ans = 1
sav = S[0]
for index in range(1, int(N)):
    if S[index] != sav:
        sav = S[index]
        ans += 1

print(ans)

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

ans = 0
sav = ""
for index in range(int(N)):
    if sav == "":
        sav = S[index]
        ans += 1
    elif S[index] != sav:
        sav = S[index]
        ans += 1

print(ans)

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

d = input()

res = 1

jud = d[0]

for i in d:
	if i!=jud:
		res += 1
	jud = i

print(res)

Solution (Python):
N=int(input())
s=input()
s_list=list(s)
import itertools as itl
list2=[k for k, v in itl.groupby(s_list)]
print(len(list2))

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

Solution (Python):
N = int(raw_input())
S = raw_input()
A = ['']
for i in range(N):
  if A[-1] != S[i]:
    A.append(S[i])
print(len(A) - 1)

Solution (Python):


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

count = 1

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

print(count)

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

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

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

last=None

for C in COLOR:
    if C==last:
        N-=1
    last=C

print(N)

Solution (Python):
gomi=input()
slime=[0]
for i in list(input()):
  
  if i != slime[-1]:
  	slime.append(i)
print(len(slime)-1)

Solution (Python):
N = int(input())
l = input()
cnt = 1
cur = l[0]

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

print(cnt)

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

count = 0
prev = ''

for l in s:
    if l != prev:
        prev = l
        count += 1
    
print(count)

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

st = []
for c in s:
    if st:
        bc = st.pop()
        if bc == c:
            st.append(c)
        else:
            st.append(bc)
            st.append(c)
    else:
        st.append(c)

print(len(st))

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

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

print(ans+1)

Solution (Python):
number= int(input())
color =input()

change_times=0
color_before=''


for index in range(number):
	if index == 0:
		color_before= color[index]
	elif color[index] == color_before:
		continue
	else:
		change_times=change_times+1
		color_before= color[index]
		
print(change_times+1)

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

a = list()
a.append('qqq')

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

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

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

print(n-an)

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

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

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

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

print(sum + 1)

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

ans = 0

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

print(ans + 1)

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

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

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

Solution (Python):

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

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

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

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

S_n_1 = S[0]
resList = list()
for i in range(1, N):
    S_n = S[i]
    if S_n != S_n_1:
        resList.append(S_n_1)
    S_n_1 = S_n
resList.append(S_n_1)
print(len(resList))

Solution (Python):



s = [input() for i in range(2)]

N = int(s[0])
S = list(s[1])


M = 0

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

N = N - M


print(N)

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

now=slime[0]
ans=1

for s in slime:
    if now == s:
        continue
    ans+=1
    now=s
print(ans)

Solution (Python):
n = int(input())
s = input()
p = list(s)
i=1
while len(p)>i:  
    if p[i-1]==p[i]:
        del p[i]
    else:
        i+=1

print(len(p))

Solution (Python):
N=int(input()); S=list(input()); i=0
while i+1<len(S):
    if S[i]==S[i+1]:
        S.pop(i+1)
    else:
        i+=1
print(len(S))

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

pos = 0
while True:
  if pos >= len(S) - 1:
    break
  if pos <= len(S) - 2 and S[pos] == S[pos+1]:
    S = S[:pos+1] + S[pos+2:]
    continue
  else:
    pos += 1
    
print(len(S))

Solution (Python):





N = int(input())
Sn = str(input())

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

Solution (Python):






from sys import stdin,setrecursionlimit





setrecursionlimit(10**6)
input=stdin.readline

n=int(input().rstrip())
s=input().rstrip()

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

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

cnt = 1
S_list = [s for s in S]
S_list1 = S_list[1:]
for s,s1 in zip(S_list,S_list1):
    if s != s1:
        cnt += 1
print(cnt)

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

cnt = 1
S_list = [s for s in S]

for i in range(N):
    if S_list[N-1-i] != S_list[N-1-(i+1)] and N-1-(i+1)>=0:
        
        cnt += 1
    
print(cnt)

Solution (Python):
from itertools import groupby
n = int(input())
s = input()
ans = 0
for key, value in groupby(s):
    ans += len(list(key))
print(ans)

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

before = ""
answer = 0
for w in s:
    if w == before:
        pass
    else:
        answer += 1
        before = w
print(answer)

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

Solution (Python):

import sys

import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

n = readi()
s = list(read())
ans = 0
ans = 1
t = s[0]
for i in range(n):
    if t != s[i]:
        t = s[i]
        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):
from collections import deque

n = int(input())
l = deque(list(input()))
pre = l.pop()
ans = 1

for _ in range(n-1):
    now = l.pop()
    if now != pre:
        ans += 1
    pre = now
print(ans)

Solution (Python):
input()
S = input()
before_str = ""
cnt = 0
for str in S:
  if str != before_str:
    cnt += 1
    before_str = str
print(cnt)

Solution (Python):
x = input()
x = int(x)
y = input()

res = ""
for i,sra in enumerate(y):
  if i == 0:
    res += sra
  elif y[i-1] == sra:
    pass
  else:
    res += sra
    
print(len(res))

Solution (Python):
n = int(input())
s = list(input())
summary = 1
prefchar = s[0]
for idx in range(n -1):
    if prefchar != s[idx+1]:
        summary = summary + 1
        prefchar = s[idx+1]
print(summary)

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

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

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

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

print(ans)

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

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

Solution (Python):
N = int(input())
c = [str(x) for x in input()]

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

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

prev_s = ""
ans = 0

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

Solution (Python):
if __name__ == "__main__":
  num = input()
  slimes = input()

  tmp = []
  for i in range(0,len(slimes)):
    if len(tmp):
      if slimes[i] != tmp[-1]:
          tmp.append(slimes[i])
    else:
      tmp.append(slimes[i])
  print(len(tmp))

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

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

Solution (Python):
from sys import stdin

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

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

print(ans)

Solution (Python):
afterslimes = 0
a = input()
b = input()

lenslime = len(b)
tempslime = None

for i in range(lenslime):
	if b[i] != tempslime:
		afterslimes += 1
		tempslime = b[i]

print(afterslimes)

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

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

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

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):
from sys import stdin
import itertools as it
import functools as fc


def fin(f):
    return f(input())


def gin(f, n=1):
    for _ in range(n):
        yield list(map(f, stdin.readline().split()))


def lin(f):
    return next(gin(f))


N = fin(int)

S = fin(list)

ans = [""]
for s in S:
    if not ans[-1] == s:
        ans.append(s)

print(len("".join(ans[1:])))

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

color = s[0]
ans = 1
for i in range(1,len(s)):
    next_color = s[i]
    if next_color != color:
        ans += 1
        color = s[i]
print(ans)

Solution (Python):
input = raw_input

N = int(input())
s = input().strip()

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

Solution (Python):
import re
N = input()
S = input()
S_fusion = re.sub(r"([a-z])\1*", r"\1", S)
print(len(S_fusion))

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):
import re

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

rex = r'(.)\1{0,}'
pattern = re.compile(rex)
ans = pattern.findall(S)

print(len(ans))

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

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

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

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

print(count)

Solution (Python):
n=int(input())
s=list(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=str(input())
c=''
t=0
for s in S:
    if s==c:continue
    t+=1
    c=s
print(t)

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

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

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

print(count)

Solution (Python):
N=int(input())
S=str(input())
c=''
t=0
for s in S:
    if s==c:
        t+=1
    c=s
print(N-t)

Solution (Python):
N = int ( input() )
slimes = str( input() )
list_slimes = list( slimes )
while(True):
  counter = 0
  i = 0
  while(i<len(list_slimes)-1):
    if list_slimes[i] == list_slimes[i+1]:
      del list_slimes[i]
      counter += 1
    i += 1
  if counter == 0:
    break

print( len (list_slimes) )

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 sys

count = 0
input = sys.stdin.readline

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

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

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

Solution (Python):

N=int(input())
S=input()
New=[]
for i in range(N-1):
    New.append(S[i])
    if S[i] == S[i+1]:
        New.pop()
if len(New) == 0 or S[-1] != New[-1]:
    New.append(S[-1])

print(len(New))

Solution (Python):
N = int(input())
S = input()
PreviousColor = "."
SlimCount = 0
for n in range(N):
    if(PreviousColor != S[n]):
        SlimCount += 1
        PreviousColor = S[n]
print(SlimCount)

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