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

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

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

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

ans = list()
for i in S:
    try:
        if i != ans[-1]:
            ans.append(i)
    
    except:
        ans.append(i)

print(len(ans))

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

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

ans = 1

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

Solution (Python):
import itertools 

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

s = itertools.groupby(S)
ans = []
for key, group in s:
    ans.append(key)
print(len(ans))

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

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

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

prev = S[0]
ans = ''
ans += prev
for si in S[1:]:
    if si != prev:
        ans += si
        prev = si

print(len(ans))

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

pt,pt_c,pt_tmp,ans = 1,S[0],0,1
while pt < N:
    if S[pt] != S[pt_tmp]:
        pt_c = S[pt]
        pt_tmp = pt
        ans += 1
    pt += 1

print(ans)

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

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

print(len(ans))

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

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

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

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


ans = 1

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

print(ans)

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

    current = ''
    cnt = 0
    for s in S:
        if current != s:
            cnt = cnt + 1
            
        current = s
    print(cnt)

if __name__ == '__main__':
    solver()

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

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

Solution (Python):
n = int(input())
s = input()
flg = 0
res = 1
for i in range(n-1):
  if flg == 0 and s[i] == s[i+1]:
    flg = 1
  elif flg == 1 and s[i] == s[i+1]:
    pass
  else:
    flg = 0
    res += 1
print(res)

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

print(len(s))

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

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

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

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

print(ans)

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

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

print(c)

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

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

ans=1

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

Solution (Python):
import sys

n=int(sys.stdin.readline())
s=sys.stdin.readline()

num=0

for color in s:
    if num==0:
        pre=color
        num=1
    elif color==pre:
        continue
    else:
        num+=1
        pre=color
print(num-1)

Solution (Python):
import sys

input = sys.stdin.readline

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

now = S[0]
sub = 0
for i in range(1, N):
    new = S[i]
    if new == now:
        sub += 1
    else:
        now = new
print(N - sub)

Solution (Python):
n = int(input())
a = input()
ans = 0
t = ''
for i in a:
    if i != t:
        ans += 1
    t = i
print(ans)

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

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

res = 0
str_ch = []

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

print(res)

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

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

color_uni = [x for x in color if x != 0]
print(len(color_uni))

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

print(ans)

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

Solution (Python):
import re
input()
print(len(re.sub(r'(.)\1+', ":", input())))

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

tmp = ""
ans = ""
for i in s:
    if i != tmp:
        ans += i
    tmp = i
print(len(ans))

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

x = S[0]
ans = [x]
for i in S:
    if x == i:
        x = i
    else:
        ans.append(i)
        x = i

print(len(ans))

Solution (Python):
import sys
import math

from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 
def prime_list(n):
    li = [i for i in range(2, n+1)]
    for i in range(len(li)):
        if li[i] >= int(math.sqrt(n)):
            break
        if li[i] == -1:
            continue
        for j in range(i+1, len(li)):
            if li[j] % li[i] == 0:
                li[j] = -1
    return [n for n in li if n != -1]
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while True:
        r = a % b
        if r == 0: return b
        a, b = b, r
def lcm(a, b):
    return int(a * b / gcd(a,b))
def all_subset(li):
    s = []
    n = len(li)
    for bit in range(0, (1<<(n+1))):
        ss = set()
        for i in range(0, n):
            if (bit & (1 << i)):
                ss.add(li[i])
        s.append(ss)
    return s
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

n = load()
s = load(str)

pre = s[0]
result = 1

for i in range(1, len(s)):
    if s[i] != pre:
        result += 1
    pre = s[i]

print(result)

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

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

if __name__ == '__main__':
    main()

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

res = ''
tmp = ''
for n in range(N):
  if n == 0:
    tmp = S[0]
  elif tmp != S[n]:
    res = res + tmp
    tmp = S[n]

res = res +tmp

print(len(list(res)))

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

Solution (Python):


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


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

x = S.pop(0)
while(True):
    
    if S==[]:break
    for i in range(len(S)):
        if S[0]==x:
            del S[0]
        else:
            x = S.pop(0)
            ans+=1
            break
print(ans)

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

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

Solution (Python):








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

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

    print(cnt)


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(len(s) - cnt)

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

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

print(len(l))

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

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

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

print(count)

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

Solution (Python):

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

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

Solution (Python):
n=int(input())
s=input()
new_s=[]
new_s.append(s[0])
for i in range(1,n):
    if s[i]!=s[i-1]:
        new_s.append(s[i])

print(len(new_s))

Solution (Python):
N = int(input())
s = str(input())
S = []
for j in s:
  S.append(j)
for i in range(len(S)-1):
  if S[i] == S[i+1]:
    S[i] = ''
    i -= 1
  else:
    pass
print(len(''.join(S)))

Solution (Python):
a = int(input())
b = input() 

c = 0
slimes = 1
for x in b[1:]:
  if x != b[c]:
    slimes += 1
  c += 1

print(slimes)

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

print(num)

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


def submit():
    n = int(input())
    s = input().strip()

    color_change = 1
    curr_color = s[0]
    for c in s[1:]:
        if curr_color != c:
            color_change += 1
            curr_color = c

    print(color_change)
    

if __name__ == "__main__":
    submit()

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

p = s[0]
x = s[0]
for i in range(1, n):
  if x == s[i]:
    continue
  else:
    p += s[i]
    x = s[i]

print(len(p))

Solution (Python):
from itertools import groupby

def solve():
    N = int(input())
    S = input()
    s = list(S)
    c = 0
    g = groupby(s)
    for k , v in g:
        c += 1

    return c

print(solve())

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

Solution (Python):
import re
N = int(input())
ans = input()
charset = [chr(ord("a") + i) for i in range(26)]
for c in charset:
    ans = re.sub(r"{}+".format(c), c, ans)
print(len(ans))

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

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()
list=[S[i] for i in range(N)]
for i in range(N-1):
        if list[i]==list[i+1]:
            list[i]="0"
list=[s for s in list if s != '0']
print(len(list))

Solution (Python):






import numpy as np



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

arrS = list(s)

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

print(ans)

Solution (Python):

N = int(input())
A = list(input())

count=1
dammy = A[0]

for i in range(1,N):
    if dammy != A[i]:
        count+=1
        dammy=A[i]
    else:
        continue
print(count)

Solution (Python):

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

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

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

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

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

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

Solution (Python):

"""
Created on Tue Mar 10 21:19:58 2020

@author: Kanaru Sato
"""
n = int(input())
s = input()

slime = [s[0]]

if n > 1:
    for i in range(1,n):
        if slime[-1] != s[i]:
            slime.append(s[i])

print(len(slime))

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

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

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

total = len(s)

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

print(total)

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

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

    
    print(len(result))



if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
S = list(input())
s = list(S[0])
for c in S[1:]:
    if not c == s[-1]:
        s.append(c)
print(len(s))

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

Solution (Python):
from collections import deque

N = int(input())
S = deque(list(input()))
count = 1
if len(S) == 1:
    print(1)
else:
    q = S.popleft()
    while (True):
        if q != S[0]:
            count += 1
        q = S.popleft()
        if len(S) == 0:
            break
    print(count)

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

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

ans = 1
s_before = ss[0]
for s in ss:
    if s != s_before:
        ans += 1
        s_before = s

print(ans)

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

cnt = 0
c = ""
for s in S:
    if c != s:
        cnt += 1
    c = s
print(cnt)

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

Solution (Python):
n=int(input())
S=input()
ans=0
chk=''
for s in S:
    if chk==s:
        s = ''
    else:
        ans += 1
        chk = s
print(ans)

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

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

Solution (Python):
f=input;f()
import itertools as it
print(len(list(it.groupby(f()))))

Solution (Python):
f=input;f();s=f()
import itertools as it
print(len(list(it.groupby(s))))

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

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

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

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

memo = ""
c = 0

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

print(c)

Solution (Python):
num = int(input())
s = input()
pre_s = s[0]
count = 1

for c in s:
    if(pre_s!=c) :
        count+=1
        pre_s=c

print(count)

Solution (Python):
N = int(input())
S = input()
Num = 1
s = S[0]
for i in range(1,N):
  c = S[i]
  if s==c:
    continue
  else:
    Num+=1
    s=c
print(Num)

Solution (Python):
N = int(input())
S = list(input())
out = ""
for x in range(N):
    if x == 0 or S[x] != S[x-1]:
        out += S[x]

print(len(out))

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

print(N-count)

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

print(N-count)

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

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

ans = ""

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

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

print(ans)

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

Solution (Python):
from sys import stdin
from itertools import groupby

n = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()
new = str()

for key, value in groupby(s):
    new += key

print(len(new))

Solution (Python):
from sys import stdin
from itertools import groupby

n = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()
new = []

for key, value in groupby(s):
    new.append(key)

print(len(new))

Solution (Python):
from sys import stdin
from itertools import groupby

n = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()
l = [x for x in s]
new = []

for key, value in groupby(l):
    new.append(key)

print(len(new))

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

ans = ''

cache = ''

for s in S:
    if cache == '':
        ans += s
        cache = s
        continue
    if cache == s:
        continue
    else:
        ans += s
        cache = s

print(len(ans))

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

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


check = reversed(check)

for i in check:
    s.pop(i)
    
print(len(s))

Solution (Python):
n = int(input())
s = input()
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()
a = '0'
ans = 0
for i in list(s):
	if a != i:
		ans += 1
		a = i

print(ans)

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

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

print(ans)

Solution (Python):
n=int(input())
s=input()
cnt=0
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 = input()

cnt = 0
for i in range(N-1):
    if S[i] < S[i+1] or S[i] > S[i+1]:
        cnt += 1
print(cnt+1)

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

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

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

before_i = s[0]

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

print(ans)

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

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

Solution (Python):
N=int(input())
S=input()
count=1
for n in range(1,N):
    if S[n]!=S[n-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):
import array
import sys
from collections import deque

def input():
    return sys.stdin.readline().rstrip('\n')

N = int(input())
S = deque(list(input()))
last = S.pop()
count = 1
while(not len(S)==0):
    s = S.pop()
    if not s == last:
        count +=1
        last = s
    else:
        continue
    
print(count)

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

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

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

base = s[0]
count = 1

for i in range(1,num):
  if not base == s[i]:
    count = count + 1
    base = s[i]

print(count)

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

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

Solution (Python):




def main():
    N = int(input())
    S = input()
    result = None

    for s in S:
        if result is None:
            result = s
        elif result[-1] != s:
            result += s

    print(len(result))


if __name__ == "__main__":
    main()

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

Solution (Python):



def main():
  n = int(input())
  Ss = list(input().strip())
  ans = [Ss[0]]
  for S in Ss[1:]:
    if ans[-1] == S:
      continue
    else:
      ans.append(S)
  print(len(ans))
  
if __name__=='__main__':
  main()

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

x = s[0]
summe = 1
for i in s:
  if x != i:
    summe += 1
    x = i
    
print(summe)

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











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    S=ST()
    b = ""
    a = 0
    for s in S:
        if b!=s:
            b = s
            a += 1
    print(a)
if __name__ == '__main__':
    main()

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

print(ans)

Solution (Python):

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

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

"""
def remove_adjacent(nums):
  i = 1
  while i < len(nums):    
    if nums[i] == nums[i-1]:
      nums.pop(i)
      i -= 1  
    i += 1
  return nums

remove_adjacent(s)
print(len(s))
"""

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

Solution (Python):

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

def remove_adjacent(nums):
  i = 1
  while i < len(nums):    
    if nums[i] == nums[i-1]:
      nums.pop(i)
      i -= 1  
    i += 1
  return nums

remove_adjacent(s)
print(len(s))

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

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

ans = s[0]
prev = s[0]

for i in s:
  if i != prev:
    ans += i
    prev = i
    
print(len(ans))

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

s = S[0]
i = 1
ans = 1
while(True):
    
    if i == len(S):
        break
    if s == S[i]:
        pass
    else:
        ans += 1
        s = S[i]
    i += 1
        
print(ans)

Solution (Python):
N = int(input())
S = input()
now = "?"

ans = N
for s in S:
    if s == now:
        ans -= 1
        continue
    else:
        now = s

print(ans)

Solution (Python):
import sys

def solve():
    input = sys.stdin.readline
    N = int(input())
    S = input().strip("\n")
    S += "0"
    count = 0
    nowCol = S[0]
    for i in range(1, N + 1):
        if S[i] != nowCol:
            count += 1
            nowCol = S[i]
    print(count)

    return 0

if __name__ == "__main__":
    solve()

Solution (Python):
if __name__ == "__main__":
    n = int(input())
    s = input()

    ans = s[0]
    tmp = s[0]

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

    print(str(len(ans)))

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

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

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

Solution (Python):
def main():
    N=int(input())
    S=input()
    c=1
    for i in range(N):
        if i==0:
            s=S[i]
        else:
            if s==S[i]:
                pass
            else:
                s=S[i]
                c+=1
    print(c)
if __name__=="__main__":
    main()

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

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

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

Solution (Python):
def main():
    N = int(input())
    S = input()
    from itertools import groupby
    ans = 0
    for k, v in groupby(S):
        ans += 1
    print(ans)


if __name__ == '__main__':
    main()

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

sign = S[0]
count = 0
for i in range(1,N):
    if S[i] == sign:
        count = count + 1
    else:
        sign = S[i]
print(N - count)

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

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

print(len(ans)+1)

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

cnt=0

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

print(cnt+1)

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

Solution (Python):
N=int(input())
S=input()
ans = S[0]
for i in range(N):

    if S[i] != ans[len(ans)-1]:
        ans = ans + S[i]
print(len(ans))

Solution (Python):
N = int(input())
B = list(input())
total = 0
letter = 0
for i in B:
    if letter != i:
        total += 1
        letter = i
    else:
        pass
print(total)

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

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

print(count)

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

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

print(count)

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

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

p = ''
q = 0
for i in range(n):
  if p == s[i]:
    continue
  elif p != s[i]:
    p = s[i]
    q += 1
print(q)