Problem:
 Score : 300 points    Problem Statement There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i -th slime from the left has the color that corresponds to the i -th character of S .  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?      Constraints  1 \leq N \leq 10^5  |S| = N  S consists of lowercase English letters.         Input Input is given from Standard Input in the following format:  N  S       Output Print the final number of slimes.        Sample Input 1 10
aabbbbaaca      Sample Output 1 5  Ultimately, these slimes will fuse into abaca .       Sample Input 2 5
aaaaa      Sample Output 2 1  All the slimes will fuse into one.       Sample Input 3 20
xxzaffeeeeddfkkkkllq      Sample Output 3 10

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

tmp = ''
count = 0
for s in S:
    if tmp != s:
        count += 1
    tmp = s

print(count)

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

slimes = list(input())

color = slimes[0]

for col in slimes[1:]:
  if color == col:
    N-=1
  else:
    color = col

print(N)

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

l=[s[0]]
for i in range(1,n):

    if s[i-1] != s[i]:
        l.append(s[i])

print(len(l))

Solution (Python):
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]


def get_nums_l():
    return [ int(s) for s in input().split(" ")]


def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

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

prev = s[0]
ans = 1
for c in s[1:]:
    if c != prev:
        ans += 1
        prev = c

print(ans)

Solution (Python):
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())

sys.setrecursionlimit(10 ** 9)


def main():
    N = INT()
    S = INPUT()

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

    print(cnt)

if __name__ == '__main__':
    main()

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

N_l = [0] * N
for x in range(N):
    if (x != N-1):
        if (S[x] == S[x+1]):
            N_l[x] = 1

print(N_l.count(0))

Solution (Python):
import sys
 
def main():
    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)
 
main()

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

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

print(len(ans))

Solution (Python):


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

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

Solution (Python):
import sys


def solve(inp):
    N = int(inp.readline().strip())
    S = inp.readline().strip()

    r = 1
    p = S[0]
    for c in list(S):
        if p != c:
            r += 1
        p = c

    return str(r)


def main():
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == '__main__':
    main()

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

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

print(t)

Solution (Python):
def solve():
  n = int(input())
  slimes = input()
  
  if n == 1:
    return 1

  prev = slimes[0]
  r = 1

  for slime in slimes[1:]:
    if prev == slime:
      continue

    r += 1
    prev = slime


  return r

print(solve())

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

s = input()

temp = "0"
counter = 0
for c in s:
  if c != temp:
    counter += 1
    temp = c

print(counter)

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

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

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

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

    cnt += 1
  cp = s[i]


print (cnt)

Solution (Python):
import itertools

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

    ans = [S[0]]

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

    print(len(ans))
    return 0
if __name__ == '__main__':
    main()

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

Solution (Python):
import itertools
N = int(input())
S = list(input())
gr = itertools.groupby(S)
ans = len([1 for key, group in gr])
print(ans)

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

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

ans=N

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

print(ans)

Solution (Python):
from sys import stdin
import numpy as np




def main():
    N = int(input())
    S = input()
    s = S[0]
    for i in range(1, len(S)):
        if not s[-1] == S[i]:
            s += S[i]
    print(len(s))
    return


if __name__ == "__main__":
    main()

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

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

print(count)

Solution (Python):


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

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

print(count)

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

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):
a = int(input())
mes = input()
pre = mes[0]
slimes = 0

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

print(slimes+1)

Solution (Python):
queue = []

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

for s in S:
    if len(queue) == 0 or queue[-1] != s:
        queue.append(s)

print(len(queue))

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

if __name__ == '__main__':
    main()

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

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

S_ans = []



for i, j in enumerate(S):
  if i == 0:
    S_ans.append(1)
  else:
    if S[i-1] == j:
      S_ans.append(0)
    else:
      S_ans.append(1)
      
print(sum(S_ans))

Solution (Python):
def main():

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

if __name__ == "__main__":
    main()

Solution (Python):



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

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

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

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

Solution (Python):
def main():
    N = int(input())
    S = str(input())
    
    ans = []
    now = "_"
    for i in range(N):
        if now != S[i]:
            now = S[i]
            ans.append(S[i])
            
    print(len(ans))

if __name__ == "__main__":
    main()

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

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

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

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

Solution (Python):
from sys import stdin
import sys

def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def rip(sep = ''):
    if sep == '' :
        return map(int, input().split()) 
    else: return map(int, input().split(sep))
def ria(sep = ''): 
    return list(rip(sep))
def ri(): return int(input())
def rd(): return float(input())
def rs(): return input()

def main():
    N = ri()
    S = rs()
    l = []
    l.append(S[0])
    for i in range(1,N):
        if S[i] != l[len(l) - 1]: l.append(S[i])
    print (len(l))


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
def main():
    N = int(input())
    S = input()
    result = 0
    slime = ''
    for s in S:
        if slime != s:
            slime = s
            result += 1
        else:
            continue
    print(result)


if __name__ == '__main__':
    main()

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

Solution (Python):
N=int(input())
S=input()
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()
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()
tmp = "Q"
ans = 0
for Z in S:
	if(Z != tmp):
		ans += 1
		tmp = Z
print(ans)

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

chuumoku = 1
for i in range(n):
    if chuumoku >= len(s):
        break

    if s[chuumoku] == s[chuumoku - 1]:
        s.pop(chuumoku)
    else:
        chuumoku += 1

print(len(s))

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

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

Solution (Python):
N = int(input())
S = input()
hoge = "0"
counter = 0
for i in range(N):
    if S[i] != hoge:
        counter += 1
        hoge = S[i]
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):
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()
li=""
li+=s[0]
for i in range(n):
    if i>0 and s[i]!=s[i-1]:
        li+=s[i]
print(len(li))

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

answers = [S[0]]

for i in S:
    if not i == answers[-1]:
        answers.append(i)

ans_str = "".join(answers)

ans = len(ans_str)

print(ans)

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

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

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

ans_list = [s[0]]
now_color = s[0]
for i in range(1, n):
    if now_color != s[i]:
        ans_list.append(s[i])
        now_color = s[i]
    

print(len(ans_list))

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

from math import ceil

def main():
    ans = N
    pre = S[0]
    for s in S[1:]:
        if pre == s:
            ans -= 1
        pre = s
    print(ans)
    return

if __name__ == "__main__":
    main()

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

count = 1
s ='char'

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

print(count)

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

s0 = S[0]
for s in S[1:]:
    if s == s0:
        N -= 1
    else:
        s0 = s
print(N)

Solution (Python):
n = int(input())
s = input()
last = ''
c = 0

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

print(c)

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

prev = 0
answer = 0
for x in S:
    if x != prev:
        answer += 1
    prev =x
print(answer)

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

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

print(N - count)

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

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

ans = 1
prec = S[0]
for c in S:
    if c != prec:
        ans += 1
    prec = c

print(ans)

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

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

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

i = 0
count = 0
while i < N-1:

    if S[i]==S[i+1]:
        i = (i+1)
        continue
    else:
        count = count + 1
    i = i + 1

print(count+1)

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

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

def main():
    A = input()
    B = input()
    old = ''
    ans = 0
    for b in B:
        if b != old:
            ans += 1
            old = b
    print(ans)


if __name__ == "__main__":
    main()

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

s = 1
pre = d[0]
for di in d[1:]:
    if di == pre:
        continue
    s += 1
    pre = di
print(s)

Solution (Python):
import sys

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

main()

Solution (Python):
def main():
    N = int(input())
    S = input()
    f = S[0]
    count = 0

    for i in S:
        if i!=f:
            count+=1
        f = i

    print(count+1)


if __name__ == "__main__":
    main()

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

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

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

ret = 0
prev = "prev"
for s in S:
  if s != prev:
    ret += 1
    prev = s
    
print(ret)

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

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

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

pre = S[0]
c = 1

for s in S[1:]:
    if not s == pre:
        c += 1
    pre = s

print(c)

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

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

print(len(ans))

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

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

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

print(ans)

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

l = list(S)

i = 0
while i < len(l) - 1:
    if l[i] != l[i + 1]:
        i += 1
        continue
    del l[i]

print(len(l))

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

Solution (Python):
def main():
    N = int(input())
    S = input()
    top = S[0]
    ans = 1
    for s in S:
        if s != top:
            ans += 1
            top = s
    print(ans)


if __name__ == '__main__':
    main()

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

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

color_length = []
c = 1

for i in range(n-1):
    
    if s[i] == s[i+1]:
        c += 1
    
    else:
        color_length.append(c)
        c = 1

color_length.append(c)

print(len(color_length))

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

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

Solution (Python):
from itertools import groupby
N = int(input())
S = list(input())
newS = list([list(g) for k, g in groupby(S)])
print(len(newS))

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

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

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

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

count = 0
while len(s)>1 :
    if s[0] == s[1]:
        s.pop(0)
    else:
        s.pop(0)
        count += 1

print(count+1)

Solution (Python):
n = int(input())
A = input()
A += '0'
a = 0
for j in range(n):
    if A[j] != A[j+1]:
        a += 1
print(a)

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

Solution (Python):
n=int(input())
a=input()
counter=1
startpt=0
i=1
l=len(a)
while(i<l):
    if(a[i]!=a[i-1]):
        counter+=1

    i+=1
print(counter)

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())
count = 1
for i in range(1,len(S)):
  if 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 = str(input())
ans = [s[0]]
cnt = 1
for i in range(0,n):
    if s[i] != ans[-1]:
        ans.append(s[i])
        cnt += 1
print(cnt)

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

cnt = 1

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

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

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

count = 1

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

print(count)

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

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

print(ans)

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

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

print(output+1)

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

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

Solution (Python):
def slime(string: str) -> int:
    prev = string[0]
    count = 1
    for s in string[1:]:
        if s != prev:
            count += 1
        prev = s
    return count


if __name__ == '__main__':
    N = int(input())
    S = input()
    result = slime(S)
    print(result)

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

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

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

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

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

p = s[0]
cnt = 1

for i in range(1, n):
    if p == s[i]:
        pass
    else:
        p = s[i]
        cnt += 1

print(cnt)

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

prev = s[0]
count = 1
for s_i in s[1::]:
    if prev != s_i:
        count += 1
        prev = s_i
print(count)

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())
result = [S[0]]
count = 1

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

print(count)

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

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

Solution (Python):

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

cnt = 0
i = 0
while i<n:
    j = i
    while j<n and s[i]==s[j]:
        j += 1
    i = j
    cnt += 1

print(cnt)

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
from itertools import groupby
def resolve():
    n=int(input())
    g=groupby(input())
    print(len(tuple(g)))
resolve()

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

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

print(ans)

Solution (Python):
N=int(input())
ans=1
S=input()
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(N-1):
    if S[i] == S[i+1]:
        continue
    else:
        ans += 1

print(ans)

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

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

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


if __name__ == '__main__':
    main()

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

Solution (Python):
N = int(input())
S = list(str(input()))
tmp = ""
dup_count = 0
for i in S :
	if tmp == i :
		dup_count += 1
	tmp = i
print(N - dup_count)

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

count   = 0
tgt_chr = s[0]
for ii in range(1, N):
    if s[ii]==tgt_chr:
        continue
    else:
        count += 1
        tgt_chr = s[ii]
print(count+1)

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

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

lines = sys.stdin.readlines()
n = lines[0].rstrip()
s = lines[1].rstrip()

c = s[0]
r = 1
for cursor in s[1:]:
    if cursor == c:
        pass
    else:
        r += 1
        c = cursor

print(r)

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def main():
    N = I()
    s = S()
    c = ''
    cnt = 0
    for i in range(N):
        if c != s[i]:
            cnt += 1
        c = s[i]
    print(cnt)

main()

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

Solution (Python):
from __future__ import print_function

import sys
input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return















































def main():
    n = int(input().strip())
    S = input().strip()
    cnt=1
    for i in range(1,n):
        if (S[i]==S[i-1]):
            pass
        else:
            cnt+=1
    print(cnt)
    return

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

for given n (1<=n<=10**5) ,S (1<=|S|=N<=10**5, \forall i \in [0...(N-1)].a<=S[i]<=z)



(i.e.)
aaabbcdfgggxx
abcdfgx


'''

Solution (Python):
n = int(input())
s = input()
x = ''
l = 0
for c in s:
    if x != c:
        x = c
        l = l + 1
print(l)

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



if __name__ == '__main__':
	main()

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

res = []
x = '0'
for c in S:
    if c == x:
        continue
    else:
        res.append(c)
        x = c

print(len(res))

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

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

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

    if S1 != S2:
        ans += 1

print(ans)

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

total = 1

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

print(total)

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

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

for i in range(N-1):
    while True:
        if S[i]==S[i+1]:
            S[i]=''
        else:
            break

print(len([i for i in S if i!='']))

Solution (Python):
n = int(input())
s = input()
res = 0
pre = ''
for c in s:
  if pre != c:
    pre = c
    res += 1
print(res)

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

s = list(str(input()))

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

Solution (Python):
N = int(input())
K = input()
count = 0
S = []
for j in range(N):
    S.append(K[j])
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())
cnt = 1
for i in range(n-1):
  if s[i] is not s[i+1]:
    
    cnt += 1
    
print(cnt)

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

now = S[0]
count = 1
for s in S:
    if s == now:
        continue
    else:
        now = s
        count += 1

print(count)

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

now = S[0]
count = 1
for s in S:
    if s == now:
        continue
    else:
        now = s
        count += 1

print(count)

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

ans = 0
last = ""
for i in s:
    if i != last:
        ans += 1
        last = i

print(ans)

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

Solution (Python):
input()
S=input()
t=""
a=0
for s in S:
    if s!=t:
        a+=1
        t=s
print(a)

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=int(input())
s=str(input())
ans=[]
ans.append(s[0])
cnt=0
for i in range(1,n):
  if ans[cnt]==s[i]:
    continue
  else:
    cnt+=1
    ans.append(s[i])
print(len(ans))

Solution (Python):
input()
lastc = ""
count = 0
for c in input():
    if lastc != c:
        lastc = c
        count += 1

print(count)

Solution (Python):


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

list_S = list(S)

new_list_S = [list_S[0]]
for i in range(1, len(list_S)):
    if list_S[i] != list_S[i - 1]:
        new_list_S.append(list_S[i])

print(len(new_list_S))

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

Solution (Python):
n = int(input())
s = input()
l =[s[0]]
for c in s:
  if c != l[-1]:
    l.append(c)
print(len(l))

Solution (Python):

N = int(input())
S = input()
ans_S = S[0]
char = S[0]

for i in range(1, N):
    if S[i] != char:
        ans_S = ans_S + S[i]
        char = S[i]
        
print(len(ans_S))

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

count = 0
while True:
    S = S.lstrip(S[0])
    count = count + 1
    if len(S) == 0:
        break

print(count)

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

    merged = []
    previous = ""
    for i in S:
        if i != previous:
            merged.append(i)
        previous = i

    print(len(merged))


if __name__ == '__main__':
    main()

Solution (Python):
while True:
    n = input()
    s = input()
    n = int(n)
    if(n==len(s)):
         break
    else:
        print("error")

d  = ''

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

d += s[len(s)-1]
print(len(d))

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

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

Solution (Python):
i = input()
ls = list(input())

ans = []

base = ""
for s in ls:
    if (s != base):
        ans.append(s)
        base = s

print(len(ans))

Solution (Python):
N=int(input())
s=input()
a0=0
num=0
for i in range(0,N):
    a1=s[i]
    if a0==a1:
        a0=a1
    else:
        a0=a1
        num=num+1
print(num)

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

def main():
    input()
    print(len(tuple(itertools.groupby(input().rstrip()))))

if __name__ == '__main__':
    main()

Solution (Python):
import sys
import itertools

def main():
    input()
    print(len(tuple(itertools.groupby(input()))))

if __name__ == '__main__':
    main()