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

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

Solution (Python):
n=int(input())
s=input()
ans=0
while s:
	s=s.lstrip(s[0])
	ans+=1
print(ans)

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

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

Solution (Python):
from collections import deque


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

a = S.popleft()
count = 1
for i in range(N-1):
    b = S.popleft()
    if a == b:
        a = b
        pass
    else:
        count += 1
        a = b

print(count)

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

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

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

print(count)

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

count = 0
before_corror = ''
for corror in slime:
  if before_corror != corror:
    count += 1
    before_corror = corror
print(count)

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

ans = 1
temp = s[0]
for c in s:
    if c != temp:
        ans += 1
    temp = c
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()
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]:
        continue
    else:
        count += 1
print(count)

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

Solution (Python):
import sys
from bisect import bisect_right as bsr
from collections import Counter as cnt
from collections import defaultdict as dd
from collections import deque
from fractions import gcd
from itertools import combinations as comb
from itertools import permutations as perm
from math import ceil, factorial, floor
from operator import itemgetter as ig

sys.setrecursionlimit(1000000)


args = None
INF = float("inf")
MOD = int(1e9 + 7)


def input(*ps):
    if type(ps[0]) is list:
        return [input(*ps[0][:-1]) for _ in range(ps[0][-1])]
    elif len(ps) == 1:
        return ps[0](next(args))
    else:
        return [p(next(args)) for p in ps]


def yesno(v, yes="Yes", no="No", upper=False):
    if upper:
        print([yes.upper(), no.upper()][not v])
    else:
        print([yes, no][not v])


def main():
    """エントリーポイント"""
    N = input(int)
    S = input(str)

    ans, last = 0, "*"
    for s in S:
        if not s == last:
            last = s
            ans += 1
    print(ans)


if __name__ == '__main__':
    args = iter(sys.stdin.read().split())
    main()

Solution (Python):
n = int(input())
s = input()
li = []
answer = 0
temp = ''
for i in s:
    if temp == i:
        continue
    else:
        temp = i
        answer += 1
        
print(answer)

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

before = ''
count = 0

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

print(count)

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

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

Solution (Python):
N=int(input())
S=input()
mae=S[0]
now=""
ans=S[0]
for i in range(N):
  now=S[i]
  if now==mae:
    continue
  else:
    ans+=now
    mae=now

print(len(ans))

Solution (Python):
import math
import fractions
import sys
import itertools
import numpy as np
from collections import Counter
import datetime

def input1():
	return int(input())


def input2():
	return map(int,input().split())


def input_array():
	return list(map(int,input().split()))

def keta(N):
	return len(str(N))


def input_daytime(input_time):
	time,distance=input_time.split()
	t=time.split(":")
	se=str(t[-1]).split(".")
	dt1 = datetime.timedelta(hours=int(t[0]),minutes=int(t[1]),seconds=int(se[0]),milliseconds=int(se[1]))
	return dt1

n=input1()
s=str(input())

slimes=[]
first=s[0]
slimes.append(s[0])
for i in range(0,n):
	if s[i]==first:
		continue
	else:
		first=s[i]
		slimes.append(first)
print(len(slimes))

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

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

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

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


if __name__ == '__main__':
    main()

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

ans = 1

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

print(ans)

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

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

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

Solution (Python):
n = int(input())
s = input()
ans = 0
prev = ""
for a in s:
    if prev == a:
        continue
    else:
        ans += 1
        prev = a
print(ans)

Solution (Python):

import io
import math
from math import *
from itertools import groupby

data = int(input())
dataone = input()
print(len([x[0] for x in groupby(dataone)]))

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

sum = 0
for index in range(0, len(S)-1, 1):
    if S[index]!=S[index+1]:
        sum = sum + 1
        continue
print(sum+1)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = input()

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

Solution (Python):
N = int(input())
S = input()
def RLE(S): 
    res = []
    if len(S)==0:
        return res
    now = S[0]
    id = 1
    num = 1
    while id < len(S):
        if now==S[id]:
            num+=1
            id+=1
        else:
            res+=(now,num),
            now=S[id]
            num=1
            id+=1
    res+=(now,num),
    return res 
print(len(RLE(S)))

Solution (Python):
import sys

n, s = sys.stdin.read().split()

def main():
    cnt = 0
    prev = '$'
    for c in s:
        if c == prev: continue
        cnt += 1
        prev = c
    print(cnt)

if __name__ ==  '__main__':
    main()

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

cnt=0
color=s[0]

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

cnt+=1
print(cnt)

Solution (Python):










mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    
    n = int(input())
    s = input()
    res = 0
    i = 0
    while i < n:
        j = i
        
        while True:
            if j < n:
                if s[j] == s[i]:
                    j += 1
                else:
                    break
            else:
                break
        i = j
        res += 1
    print(res)

if __name__ == '__main__':
  main()

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

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    n = ri()
    s = input()
    bc = '!'
    ans = 0
    for c in s:
        if c != bc:
            ans += 1
        bc = c
    print(ans)


if __name__ == '__main__':
    main()

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

Solution (Python):
n=int(input())
S=input()
s=[str(c) for c in S]
l=len(s)
k=l
for i in range(1,l):
  if s[i]==s[i-1]:
    k-=1
print(str(k))

Solution (Python):

import sys
import numpy as np


def solve(N: int, S: str):
    ans = []
    for i in range(N):
        c = S[i]
        if i==0:
            ans.append(c)
        else:
            if c!=ans[-1]:
                ans.append(c)
    print(len(ans))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    S = next(tokens)  
    solve(N, S)

if __name__ == '__main__':
    main()

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

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

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

prev = None
answer = 0
for Si in S:
    if  Si != prev:
        answer += 1
        prev = Si

print(answer)

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

Solution (Python):

N = int(input())
S =input()
S_list =[i for i in S]


S_2 =[]
S_2.append(S[0])
for i in range(N):
    for j in range(len(S)-1):
        if S[j] != S[j+1]:
            S_2.append(S[j+1])
    S="".join(S_2)
    break
print(len(S))

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

Solution (Python):
n = int(input())
s = list(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()
a =[]
for i in range(n-1):
    if s[i] !=s[i+1]:
        a.append(s[i])

print(len(a)+1)

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

ans=[]
pre=""
for i in s:
    if i!=pre:
        ans.append(i)
        pre=i
print(len(ans))

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

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

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

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

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

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

count = 1
x = 1
for a in S[0:N-1]:
    if a != S[x]:
        count += 1
    x += 1
    

print(count)

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

prev = ''
ans = ''
for s in S:
    if s != prev:
        ans += s
        prev = s

print(len(ans))

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

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

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

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

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

print(n - cnt)

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

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

print(ans)

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

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

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

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

Solution (Python):
def q3():
    from collections import deque
    N = int(input())
    S = deque(list(input()))
    ans = deque()
    for i in range(len(S)):
        s = S.popleft()
        
        if len(S) > 0 and s != S[0]:
            ans.append(s)
    print(len(ans) + 1)


if __name__ == '__main__':
    q3()

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

ans = 1
prev = S[0]

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

print(ans)

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

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):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    s=input()
    ans=1
    for i in range(n-1):
        if s[i+1]!=s[i]:ans+=1
    print(ans)

if __name__=='__main__':
    main()

Solution (Python):
N = int(input())
ls = list(input())
count = 1
for i in range(N-1):
  if ls[i] != ls[i+1]:
    count += 1
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):
"""
int(input())
map(int,input().split())
list(map(int,input().split()))

"""

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

print(len(a))

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

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

pointer1 = 0
pointer2 = 1
ans = []
ans.append(s[0])
while (pointer2 <= n-1):
  if s[pointer2] == s[pointer1]:
    pointer2 += 1
  elif s[pointer2] != s[pointer1]:
    pointer1 = pointer2
    pointer2 = pointer1 + 1 
    ans.append(s[pointer1])
    
print(len(ans))

Solution (Python):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())
from itertools import accumulate as acc
import operator as op
import copy as cp
import math 

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

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

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

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

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

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

for c in S:
    if c==tmp:
        continue
    tmp = c
    cnt+=1
print(cnt)

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

new_S = []

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

print(len(new_S))

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

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

ans = 1
b = S[0]

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

print(ans)

Solution (Python):
N=int(input())
S=list(input())
pre=S.pop(0)
new=pre

for s in S:
    if(pre!=s):
        new+=s
        pre=s
print(len(new))

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

count = 0
prev = ''

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

print(count)

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

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

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

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

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

n=I()
s=input()
count=0
for i in range(n-1):
    k=s[i:i+1]
    l=s[i+1:i+2]
    if k==l:
        count+=1
ans=n-count
print(ans)

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

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

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

    else:
        pass
print(len(s)-s.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())
S=input()

ans=[]

bf = ''
for v in S:
    

    if bf != v:
        ans.append(v)
        bf = v
    

print(len(ans))

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

L = [S[0]]

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

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

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

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

Solution (Python):
N = int(input())
S = input()
ans  = list()
for i in range(N-1):
    if not S[i] == S[i+1]:
        ans.append(S[i])
ans.append(S[-1])
A = "".join(ans)
print(len(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()
result = s[0]
for i in s:
    if result[-1] != i:
        result += i
print(len(result))

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

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

tmp = s_list[0]
slime = [tmp]

for i in range(1,n):
    if tmp != s_list[i]:
        slime.append(s_list[i])
        tmp = s_list[i]
        
print(len(slime))

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

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

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

Solution (Python):
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect



import numpy as np
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial, log, log10, log2
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
from datetime import datetime as dt

def main():
  n = int(readline())
  s = input()
  last = ''
  ans = 0
  for i in range(n):
    if last != s[i]:
      last = s[i]
      ans += 1
  print(ans)
  
  
  
  
if __name__ == '__main__':
  main()

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

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

Solution (Python):
N = int(input())
S = input()
ans, i = 0, 0
while i < N:
  ans += 1
  while i + 1 < N and S[i + 1] == S[i]:
    i += 1
  i += 1
print(ans)

Solution (Python):
n=int(input())
s=input()
t=s[0]
re=t
for ss in s:
    if t!=ss:
        re+=ss
        t=ss
print(len(re))

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

for x in s:
  if x != list1[-1]:
    list1.append(x)
    
print(len(list1))

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

for x in s:
  if x != ans[-1]:
    ans += x

print(len(ans))

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

plev = ''
cnt = 0

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

    plev = s[i]

print(cnt)

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby
    
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

    n = int(input())
    s = input().rstrip()
    res = 0
    for k,v in groupby(list(s)):
        res += 1
    print(res)

if __name__ == '__main__':
    main()

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby
    
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

    n = int(input())
    s = input().rstrip()
    res = 0
    for k,v in groupby(list(s)):
        res += 1
    print(res)

if __name__ == '__main__':
    main()

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

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

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

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

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

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
dup = s[0]
for i in range(1, n):
    if dup != s[i]:
        dup = s[i]
        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()
ans = [S[0]]
if len(S) == 1:
    print(1)
    exit()
for i in range(1,N):
    if S[i] == S[i-1]:
        continue
    else:
        ans.append(S[i])
print(len(ans))

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

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

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

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

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

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

print(n-kieru)

Solution (Python):

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

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

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

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
from itertools import groupby
def main():
    N = int(input())
    S = input().rstrip("\r\n")
    print(len(list(groupby(S))))
if __name__ == "__main__":
    main()

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

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

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

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

print(cnt + 1)

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

Solution (Python):
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
S = sr()
answer = 1
for x, y in zip(S, S[1:]):
    if x != y:
        answer += 1
print(answer)

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

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

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

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

print(cnt)

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

print(len(res))

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

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

print(ans)

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

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

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

cnt = 0
pre = '0'
for c in s:
    if c != pre:
        cnt += 1
    pre = c
print(cnt)

Solution (Python):
N = int(input())
S = input()
ans = ''
w = ''
for slime in S:
  if w=='':
    w = slime
    ans = slime
    continue
  if w!=slime:
    w = slime
    ans += slime
print(len(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)