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

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

Solution (Python):
from collections import deque

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

queue = deque((S[0],))

for c in S[1:]:
    if queue[-1] == c:
        continue
    queue.append(c)

print(len(queue))

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 sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()
S = rs()

import itertools

G = list(itertools.groupby(S))
print(len(G))

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

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

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

Solution (Python):
import sys

n,  s = sys.stdin.read().split()
n = int(n)
res = 1
prep = s[0]
for i in s[1:]:
  if i == prep:
    continue
  prep = i
  res += 1
print(res)

Solution (Python):
def slimes(n, s):
   
  u_slime = [s[-1]]
  for i in range(n-1):
    if not s[i] == s[i+1]:
      u_slime.append(s[i])
  
  print(len(u_slime))

if __name__ == "__main__":
  n = int(input())
  s = input()
  slimes(n, s)

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

s=input()

m = s[0]
cnt = 1
for i in s:
    if m[0] != i:
        m = i
        cnt += 1

print(cnt)

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


result = re.sub(r"(.)\1{1,}", "\g<1>", s)  
print(len(result))

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

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

resolve()

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

same = False
while not same:
  same = True
  i = 0
  while i+1 < N:
    if S[i] == S[i+1]:
      S = S[:i] + S[i+1:]
      N -= 1
      same = False
    else:
      i += 1

print(len(S))

Solution (Python):
n=int(input())
s=list(input())
l=""
r=[]
for ii in range(n):
  if s[ii]==l:
    pass
  else:
    l=s[ii]
    r.append(l)

print(len(r))

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

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

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

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

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

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

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

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

new = s[0]
count = 1

for i in s:
  if new == i:
    continue;
  else:
    count += 1
    new = i
  
print(count)

Solution (Python):
import itertools
import math
import fractions
import functools
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):
import itertools
input()
s = input()
print(len(list(itertools.groupby(s))))

Solution (Python):

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

ans=1
i=0
while i<N:
    if i==0:
        MAE=S[i]
    else:
        if S[i]==MAE:
            MAE=S[i]
            pass
        else:
            MAE=S[i]
            
            ans+=1
    i+=1
    
print(ans)

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,S=int(input()),list(input())
ans=0
c=1
while c<N:
    if S[c]!=S[c-1]: ans+=1
    c+=1
print(ans+1)

Solution (Python):

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

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

print(len(op))

Solution (Python):
N = int(input())
sList = list(input())
count = 0
tmp = ''
for s in sList:
    if(s != tmp):
        count += 1
        tmp = s

print (count)

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

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

for i in s:
  if i!=be:
    count+=1
    
  be=i
  
print(count)

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

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

print(len(S)-dl)

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())
color=list(input())
ans=[color[0]]
for i in range(n-1):
    if color[i]!=color[i+1]:
        ans.append(color[i+1])
print(len(ans))

Solution (Python):
n = int(input())
s = input()
r = n
for i, j in enumerate(s):
    if i == n - 1:
        break
    if j == s[i + 1]:
        r -= 1
print(r)

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

Solution (Python):

import math
n = int(input())

s = list(input())

d = 0


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

Solution (Python):


import numpy as np

def rle(x):
    ''' Run Length Encoding

    rle('001111000000011')
    (array([2, 4, 7, 2]),
     array(['0', '1', '0', '1'], dtype='<U1'))

    rle('aabcccbbbaab')
    (array([2, 1, 3, 3, 2, 1]),
     array(['a', 'b', 'c', 'b', 'a', 'b'], dtype='<U1'))
    '''
    x = np.array(list(x))
    n = len(x)
    if n == 0:
        return (1, '')
    y = list(map(lambda a, b: a != b, x[1:], x[:-1]))
    i = np.hstack((np.where(y)[0]+1, n))
    return (np.diff(np.hstack((0, i))), x[i-1])

n = int(input())
s = input()
a = rle(s)
print(len(a[0]))

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

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

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

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

print(len(slime))

Solution (Python):
def resolve():
    n=int(input())
    s=input()
    ans=1
    for i in range(1,n):
        if s[i-1]!=s[i]:
            ans+=1
    print(ans)
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()
kuroda = s + "A"
count=0

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

Solution (Python):
n = int(input())
s = input()
now = "0"
c = 0
for e in s:
  if now != e:
    c += 1
    now = e
print(c)

Solution (Python):
n = int(input())
s = input()
s_list = list(s)
pre_slime = ''
a = 0
for slime in s_list:
  if pre_slime == slime:
    a += 1
  pre_slime = slime
print(len(s_list)-a)

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

List=[S[0]]
for i in range(N):
    if List[-1]!=S[i]:
        List.append(S[i])
    
print(len(List))

Solution (Python):

from itertools import *
from operator import itemgetter

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

def unique_justseen(iterable, key=None):
    return map(next, map(itemgetter(1), groupby(iterable, key)))

print(len(list(unique_justseen(s))))

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

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

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

Solution (Python):
n = int(input())
s = str(input())
slist = []
for i in range(n):
  slist.append(s[i])
slime = slist[0]
fslist = []
fslist.append(slime)
for i in range(1, n):
  if slime != slist[i]:
    fslist.append(slist[i])
    slime = slist[i]
print(len(fslist))

Solution (Python):
from sys import stdin

def main():
    N = int(stdin.readline().rstrip())
    S = list(stdin.readline().rstrip())
    X = S[0]
    A = 1
    for i in range(1,N):
        if S[i] != X:
            A += 1
            X = S[i]
    print(A)

main()

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

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

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

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

print(count)

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())
l=list(i for i in input())
s=l[0]
ans=1
for i in range(1,n):
    if s==l[i]:
        pass
    else:
        ans+=1
        s=l[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):
import sys
import os
import math
import bisect
import collections
import itertools
import heapq

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    S = itertools.groupby(iss())
    print(len(list(S)))


if __name__ == '__main__':
    main()

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

Solution (Python):
import sys

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

Solution (Python):
def main():
    input()
    s = input()
    a = []
    for v in s:
        if not a or a[-1] != v:
            a.append(v)
        else:
            pass
    print(len(a))

if __name__ == '__main__':
    main()

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

count = 1

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

print(count)

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce


import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


n = I()
s = S()

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

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

Solution (Python):
import numpy as np
import sys
from collections import defaultdict
read = sys.stdin.buffer.read
readline = sys.stdin.readline
readlines = sys.stdin.buffer.readlines

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

ans = 1
tmp = S[0]
for s in S:
    if s != tmp :
        ans += 1
        tmp = s

print(ans)

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def printlist(lst, k='\n'): return k.join(list(map(str, lst)))
INF = float('inf')

def solve():
    n = II()
    S = list(input())

    cnt = 0
    pre = ''
    for s in S:
        if pre == s:
            continue
        else:
            cnt += 1
            pre = s
    print(cnt)


if __name__ == '__main__':
    solve()

Solution (Python):
import numpy as np

N = int(input())
S = np.array(list(input()))
tmp = S[1:]
tmp = np.append(tmp, "-1")

print(S[~(S==tmp)].shape[0])

Solution (Python):


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

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

print(len(ans))

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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    l=[]
    n=int(input())
    s=input()
    imamade=0
    cnt=0
    for i in range(n):
        if s[i]!=imamade:
            cnt+=1
            imamade=s[i]
    print(cnt)
resolve()

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

Solution (Python):
n = int(input())
s = input()
pre = s[0]
i = 1
a = ''
while True:
    if i == n:
        a += pre
        break
    if s[i] == pre:
        i += 1
        continue
    a += pre
    pre = s[i]
    i += 1
print(len(a))

Solution (Python):





from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product










import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    N=int(input())
    A=list(input())
    gr = groupby(A)
    cnt=0
    for key, group in gr: 
        """ex.
        0: [0, 0, 0]
        1: [1, 1]
        0: [0, 0, 0]
        1: [1, 1]
        0: [0]
        1: [1]
        """
        cnt+=1
    print(cnt)
        

    
resolve()

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

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

print(ans)

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

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

s = input()

ans = 1
for i in range(len(s)):
    if (i+1) % len(s) == 0:
        break

    now = s[i]
    nxt = s[i+1]

    if now != nxt:
        ans += 1


print(ans)

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

l=list(S)
ans=[l[0]]
for n in range(1,N):
    if l[n]!=l[n-1]:
        ans.append(l[n])

print(len(ans))

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

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

count += 1

print(count)

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 = 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()
del_obj =[]
for i in range(N-1):
    if S[i]==S[i+1]:
        del_obj.append(i)
print(N-len(del_obj))

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 collections import deque


def main():
    N = int(input())
    S = input()
    before_char = None
    merged_chars = deque()
    for i, c in enumerate(S):
        if c != before_char and before_char is not None:
            merged_chars.append(before_char)
        before_char = c
        if i == N - 1:
            merged_chars.append(c)
    print(len(merged_chars))


if __name__ == '__main__':
    main()

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

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

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

i = 0
res = 0
c = ""
while i < N:
    if c != S[i]:
        res += 1
        c = S[i]
    i += 1

print(res)

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

from itertools import groupby

slime = groupby(S)

ans=0
for key ,_ in slime:
    ans+=1

print(ans)

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

count = 0
prev = None
for i in list(s):
  if i!=prev:
    count += 1
  prev = i
    
print(count)

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

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
cur = S[0]
for i in range(1,N):
  s = S[i]
  if cur == s:
    continue
  else:
    cur = s
    ans += 1
print(ans)

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 = input()
S_new = ''
for i in range(len(S)-1):
    if S[i] != S[i+1]:
        S_new += S[i]


print(len(S_new)+1)

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

Solution (Python):

import numpy as np
from collections import deque
import collections

mod = 10 ** 9 + 7
N = int(input())
S = (input())
prev_c = S[0]
count = 1
for s in S[1:]:
    if (prev_c == s):
        continue
    else:
        prev_c = s
        count += 1
print(count)

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

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

for i in range(1, len(S)):
  if S[i] == S[i-1]:
    continue
  else:
    count += 1

print(count)

Solution (Python):
N = int(input())
S = list(input())
cnt = 0
b = 10
for i in S:
    if i != b:
        cnt += 1
        b = i
print(cnt)

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

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

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

print(count)

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

o = ""
l = ''
for i in range(n):
    if(s[i] != l):
        o += s[i]
        l = s[i]
print(len(o))

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

Solution (Python):
N=int(input())
S=input()
ans=0
for i in S:
    if S!='':
        S=S.lstrip(S[0])
        ans+=1
    else:
        break
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 = list(input())
w = ''
c = 0
for i in s:
    if w != i:
        c+=1
        w = i
print(c)

Solution (Python):
n = int(input())
s = str(input())
t = str()
cnt = int()
for ch in s:
    if t[-1:] != ch:
        t += ch
        cnt += 1

print(cnt)

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

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

ans = len(s)-s.count(0)

print(ans)

Solution (Python):
def main():
    _ = int(input())
    S = input()
    num = 0 
    prev_s = ""
    for s in S:
        if s != prev_s:
            num += 1
        prev_s = s
    print(num)


if __name__ == "__main__":
    main()

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):
if __name__ == '__main__':
    n = int(input())
    s = list(input())
    ans = [s[0]]
    for i in range(1, n):
        if s[i] != ans[-1]:
            ans.append(s[i])
    print(len(ans))

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

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

h = 0
ans = 1
for i in range(1, n):
    if S[i] == S[h]:
        pass
    else:
        ans += 1
        h = i
print(ans)

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

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

print(ans)

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

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):
from itertools import groupby

n = int(input())
s = input()
print(len(list(groupby(s))))

Solution (Python):
N = int(input())
M = N
slime = input()

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

print(M)

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

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

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

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

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

Solution (Python):
input()
last = '0'
ans = 0
for c in input():
    if last != c:
        last = c
        ans += 1
print(ans)

Solution (Python):
n=int(input())
s=input()
print(len([a for a,b in zip(s,s[1:]) if not a==b])+1)

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

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

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

Solution (Python):
import os

def main():
	n = int(input())
	s = input()
	count = 1
	erser_count = 0
	for i in s:
		if count == len(s):
			break
		if i == s[count]:
			erser_count += 1
		count += 1
	print(n - erser_count)

if __name__ == "__main__":
	main()

Solution (Python):
import sys
N = int(input())
if N == 1:
  print(1)
  sys.exit()
  
S = input()
ans = 1
for n in range(len(S)-1):
  if S[n] != S[n+1]: ans +=1
print(ans)

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

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

import itertools

l = [k for k, v in itertools.groupby(S)]
print(len(l))

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

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

print(ans)

Solution (Python):
n = int(input())
s = input()
l = []

for i in range(len(s)):
    l.append(s[i])

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

print(len("".join(l)))

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()
dum = ""
ans = ""
for i in s:
    if dum != i:
        ans += i
    dum = i
print(len(ans))

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

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

Solution (Python):
import sys
import math
from collections import Counter
import itertools



def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())

def LI(): return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'


p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")



N=II()
S=SR()

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

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

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

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

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

Solution (Python):
N = int(input())
string = str(input())
string =list(string)
index = 0 
i = 0
res = []

while index<len(string):
	res.append(string[index])
	
	while index<len(string) and res[-1]==string[index]:
		index+=1
	i+=1
print(len(res))

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

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

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

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


print(res)

Solution (Python):
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

n = I()
s = S()

cc = ""
cnt = 0
for char in s:
    if cc == char:
        continue
    cnt += 1
    cc = char

print(cnt)

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

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

print(N-cnt)

Solution (Python):
N = int(input())
S = input()
s = ''
tCheck = ''
for i in S:
  tNow = i
  s += tNow if tNow != tCheck else ''
  tCheck = tNow
print(len(s))

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

for i in range(n-1):
    if s_list[i] == s_list[i+1]:
        s_list[i] = "0"

ans = n - s_list.count("0")
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=list(input())
p=0


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

print(N)

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

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

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

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)