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


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    s = str(readline().rstrip().decode('utf-8'))
    cnt = 0
    for i in range(1, n):
        if s[i] != s[i-1]:
            cnt += 1
    print(cnt + 1)


if __name__ == '__main__':
    solve()

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

for i, s in enumerate(S):
    if i == 0:
        slime = s
        continue
    if slime != s:
        c += 1
        slime = s

print(c+1)

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n=int(input())
s=input()

cnt=0

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

Solution (Python):

import sys


def solve(N: int, S: str):
    lists = list(S)
    sample = ""
    for item in lists:
        if len(sample) == 0:
            sample += item
        elif sample[-1] != item:
            sample += item
    print(len(sample))
    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())
sl = input()

f_sl = 1
for i in range(1, N):
    if sl[i] == sl[i-1]:
        continue
    else:
        f_sl += 1

print(f_sl)

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

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

l = [i for i in s if i != 0]

print(len(l))

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

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

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

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

N = int(input())
s = 1
S = list(input())
for i in range(N-1):
    if S[i+1] != S[i]:
        s += 1
    else:
        continue
print(s)

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

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



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

Solution (Python):
n=int(input())
s=input()
ans=1
if(n==1):
  print(1)
else:
  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

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

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

cnt = 1
for i, c in enumerate(s[:-1]):
    if c == s[i+1]:
        continue
    cnt += 1
print(cnt)

Solution (Python):
import itertools

_ = input()
s = input()

r = 0
for v in itertools.groupby(s):
    r += 1

print(r)

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

tmp = n

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

print(tmp)

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

i = 0
try:
    while i < N:
        if S[i] == S[i + 1]:
            S.pop(i+1)
        else:
            i += 1
except IndexError:
    pass

print(len(S))

Solution (Python):
N=int(input().strip())
S=input().strip()
tmp=S[0]
counter=1
for s in S:
    if s==tmp:
        continue
    else:
        counter+=1
        tmp=s
print(counter)

Solution (Python):
N = int(input())
S = input()
now_character = None
ans = 0
for i in range(N):
    if now_character == S[i]:
        pass
    else:
        now_character = S[i]
        ans+=1

print(ans)

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

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

Solution (Python):
N = int(input())
S = input()
S = list(S)
resultList = []
tmp = '-1'
for i in range(0, N):
    if tmp != S[i]:
        resultList.append(S[i])
        tmp = S[i]
    else:
        continue

print(len(resultList))

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

i = 0
while i<len(s)-1:
  if s[i] == s[i+1]:
    del s[i]
  else:
    i += 1
print(len(s))

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

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

print(count)

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):
input()
S = input()
runlength = []
begin, end = 0, 0
for i in range(len(S) - 1):
    if S[i] != S[i + 1]:
        end = i + 1
        runlength.append(S[begin:end])
        begin = i + 1
runlength.append(S[begin : len(S)])
print(len(runlength))

Solution (Python):
N = int(input())
S = input()
s = []
count = N
for line in S:
    s.append(line)
for i in range(N-1):
    if s[i] == s[i+1]:
        count -= 1
print(count)

Solution (Python):
n=int(input())
s=list(input())
L=[]
bef="A"
for i in range(n):
    if s[i]!=bef:
        L.append(s[i])
    bef=s[i]
print(len(L))

Solution (Python):

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

num_of_slimes = 1
color_of_left = S[0]

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

print(num_of_slimes)

Solution (Python):
from itertools import groupby

N = input()
S = input()

print(len(list(groupby(S))))

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

Solution (Python):
def solve(s: str) -> int:
  ret = 0
  cur_c = None
  for c in s:
    if c != cur_c:
      ret += 1
      cur_c = c
  return ret


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

print(solve(s))

Solution (Python):
n = int(input())
s = input()
 
before = 'aaa'
ans = 0
for char in s:
  if char != before:
    before = char
    ans += 1
print(ans)

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    a, b = LI()
    print(max(0, a - 2 * b))
    return


def B():
    n = II()
    d = LI()
    ans = 0
    for i in range(n):
        for k in range(i+1, n):
            ans += d[i] * d[k]
    print(ans)
    return


def C():
    n = II()
    s = S()
    i = 0
    ans = 1
    for i in range(1, n):
        if s[i - 1] == s[i]:
            continue
        ans += 1
    print(ans)
    return


def D():
    n = II()
    l = LI()
    l.sort()
    ans = 0
    for i in range(n - 1, 0, -1):
        for k in range(i - 1, -1, -1):
            ab = l[i] - l[k]
            c = max(0, k - bisect_right(l, ab))
            ans += c
    print(ans)
    return


def E():
    n, m, l = LI()
    dist = [[inf] * n for i in range(n)]

    for _ in range(m):
        a, b, c = LI_()
        c += 1
        if c > l:
            continue
        dist[a][b] = c
        dist[b][a] = c

    supply = [[n] * n for i in range(n)]
    for k in range(n):
        distk = dist[k]
        for i in range(n):
            if i == k:
                continue
            disti = dist[i]
            distik = dist[i][k]
            for j in range(i + 1, n):
                if distik + distk[j] < disti[j]:
                    disti[j] = distik + distk[j]
                    dist[j][i] = disti[j]

    lis = [[] for i in range(n)]
    for i in range(n):
        for j in range(i + 1, n):
            if dist[i][j] <= l:
                supply[i][j] = 0
                supply[j][i] = 0
                lis[i].append(j)
                lis[j].append(i)

    for i in range(n):
        q = []
        for k in lis[i]:
            heappush(q, (0, k))
        supplyi = supply[i]

        while q:
            time, p = heappop(q)
            for k in lis[p]:
                if supplyi[k] > time + 1:
                    supplyi[k] = time + 1
                    heappush(q, (time + 1, k))

    q = II()
    for _ in range(q):
        s, t = LI_()
        if dist[s][t] == inf:
            print(-1)
            continue
        else:
            print(supply[s][t])
    return



def F():
    return


def G():
    return


def H():
    return


if __name__ == '__main__':
    C()

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

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

print(c+1)

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

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

print(c+1)

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

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

print(ans)

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

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

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

Solution (Python):
import sys
import itertools

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  


n = ni()
s = input()
ct = 0
p = s[0]
for i in range(1, n):
    if p != s[i]:
        ct += 1
        p = s[i]
print(ct+1)

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

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

print(len(S))

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

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

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

print(len(ans))

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

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

    peek += 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()
E = []
E.append(S[0])
for i in range(0,N-1):
  a = S[i]
  b = S[i+1]
  if a != b:
    E.append(b)
print(len(E))

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

Solution (Python):

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

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

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

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

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

Solution (Python):
import re
N = int(input())
S = input()
COLORS = list(set(list(S)))

for color in COLORS:
    S = re.sub('{}+'.format(color), color, S)

print(len(S))

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

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

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

Solution (Python):
N = int(input())
X = input()
S = []
for a in range(N):
    S.append(X[a])

if N == 1:
    print(1)
else:
    for i in range(1,N):
        if S[i] != S[i-1]:
            continue
        else:
            S[i-1] = 'X'
    lista = [k for k in S if k != 'X']
    print(len(lista))

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

Solution (Python):
from itertools import groupby

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

print(len([x[0] for x in groupby(S)]))

Solution (Python):
total = input()
slimes = list(input())

pre = ""
last = []

for i in slimes:
    if pre != i:
        last.append(i)
    pre = i

print(len(last))

Solution (Python):
n = int(input())
s = input()
slimes = 0
cache = ""
for i in s:
  if cache == i:
    continue
  else:
    cache = i
    slimes += 1
print(slimes)

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

Solution (Python):
n = int(input())
s = input()
f = 1
while f == 1:
  ns = ""
  pre_c = s[0]
  f = 0
  for c in s[1:]:
    if c != pre_c:
      ns += pre_c
    else:
      f = 1
    pre_c = c    
  ns += s[-1]
  s = ns
print(len(s))

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

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

cur_char = "0"
cnt = 0

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

Solution (Python):
N = int(input())
x = [j for j in input()]
i = 0

while len(x)-2>=i:
  if x[i]==x[i+1]:
    x.pop(i)
  else:
    i += 1
print(len(x))

Solution (Python):
n =int(input())
s = input()
checks = s[0]
ans = 1
for c in list(s):
  if c != checks:
    checks = c
    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):
n = int(input())
s = input()

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

Solution (Python):
_ = input()
s = input()
place_holder = s[0]
count = 1
for letter in s[1:]:
    if place_holder == letter:
        continue
    else:
        place_holder = letter
        count +=1
print(count)

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

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

print(len(result))

Solution (Python):


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

S = S + "0"
string = []

for i in range(N):
  if i != N and S[i] != S[i+1]:
    string.append(S[i])
  i += 1
  
print(len(string))

Solution (Python):
n = int(input())
string = input()
count = 1
pivot = string[0]
for s in string[1:]:
    if s != pivot:
        count += 1
        pivot = s
print(count)

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

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

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

prev = S[0]

num = 1
for s in S[1:]:
    if prev != s:
        num += 1
    prev = s

print(num)

Solution (Python):
N = int(input())
S = input()
result = ''
previous = ''
for s in S:
    if s != previous:
        result += s
    previous = s
print(len(result))

Solution (Python):
N = int(input())
slimes = input()
new_slime = ''

current_letter = ''

for i in slimes:
    if i == current_letter:
        pass
    else :
        new_slime += i
    current_letter = i
print(len(new_slime))

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()
lists = list(S)

count = N
num = 0
while count>1:
    if lists[0] == lists[1]:
        count -= 1
        del lists[0]
    else:
        num += 1
        count -= 1
        del lists[0]    
ans = num+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):


 

in_N = int(input());
in_S = str(input());

S = [str(s) for s in in_S]





total = 0;
for i in range(in_N-1):
    if(S[i] == S[i+1]):
        total +=1;

        
        


 
print(in_N - total);

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

L=[s[0]]
bef=s[0]
for i in s[1:]:
      if i!=bef:
            L.append(i)
      bef=i
print(len(L))

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

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

before = None
ans = 0
for chara in S:
  if chara != before:
    ans += 1
    before = chara
print(ans)

Solution (Python):
N=int(input())
S=input()
S=list(S)
for i in range(len(S)):
    count=0
    for j in range(i,len(S)-1):
        if S[j]==S[j+1]:
            count+=1
        else:
            break
    
    if count>0:
        del S[i+1:i+count+1]
    
    if i==len(S)-1:
        break

print(len(S))

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

Solution (Python):
from itertools import groupby

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

cnt = 0
for _ in groupby(S):
  cnt += 1

print(cnt)

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

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

count = 1
now_s = s[0]

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

print(count)

Solution (Python):
_,S=input(),input();print(sum(1for a,b in zip("0"+S,S)if a!=b))

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

for s1,s2 in zip([0]+S,S):
  if s1 != s2:
    new_S += s2

print(len(new_S))

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

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

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

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

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

Solution (Python):
import sys


import math
from fractions import gcd
from collections import deque
import bisect

sys.setrecursionlimit(1000000)


def main():
    
    

    N = int(input())
    S = input()
    start = S[0]
    ret = start
    for i in range(1, N):
        end = S[i]
        if start != end:
            start = end
            ret += end
    print(len(ret))


if __name__ == "__main__":
    main()

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

Solution (Python):
N = int(input())
s = input()
ans = 1
for idx, val in enumerate(s):
    if idx == N - 1:
        break
    if s[idx + 1] != val:
        ans += 1

print(ans)

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

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

prev_c = None
count = 0
for c in S:
  if c != prev_c:
    count += 1
  prev_c = c
  
print(count)

Solution (Python):
n=input()
a=list(input())

b=0
while(b<len(a)-1):
  if a[b]==a[b+1]:
    del a[b+1]
  else:
    b=b+1
print(len(a))

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

Solution (Python):
n=int(input())
A=list(input())
q=A[0]
color=1
for i in range(1,n):
  if A[i]==q:
    continue
  else:
    color+=1
    q=A[i]
print(color)

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

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

Solution (Python):
n = input()
s = input()
counter = 0
c = ""

for i in s :

  if i != c :
    counter += 1
    c = i

print(counter)

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

print(ans)

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

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

print(ans)

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

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

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

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

tmp = s[0]
cnt = 1

for i in s:
    if i != tmp:
        tmp = i
        cnt += 1
print(cnt)

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

for x in range(N):
    if i==0:
        i += 1
        continue
    elif S[i]==S[i-1]:
        S.pop(i-1)
        N -= 1
    else:
        i += 1
print(len(S))

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 sys
if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline

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

ans = []

for i in range(len(S)-1):
	s = S[i]
	if s == S[i+1]:
		continue
	else:
		ans.append(s)

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

import math
import heapq

MOD = 10**9+7

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

data = 0

for i in range(N):
    if data == S[i]:
        S[i] = 0

    else:
        data = S[i]

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

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

Solution (Python):
x = int(input())
slime = str(input())
i = 0
scount = 1
while(i < x-1):
    if(slime[i] != slime[i+1]):
        scount += 1
    i += 1
print(scount)

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

Solution (Python):
N = int(input())
S = input()
counter = 1
opt = ""
for i, s in enumerate(S):
    if i == 0:
        opt = s
    else:
        if s == opt:
            continue
        else:
            counter += 1
            opt = s

print(counter)

Solution (Python):
n = int(input())
s = input()
si_pre = ''
ans = 0
for si in s:
    if si_pre != si:
        ans += 1
    si_pre = si
print(ans)

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

sum = 1
s_str = S[0]
for s in S:
    if s_str != s:
        s_str = s
        sum += 1
print(sum)

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

input1 = input()
input2 = input()


N = int(input1)
hairetu = list(input2)

i=0
s=0
a=0

for s in range (N*N):
    if len(hairetu)<i+2:
        break
    elif hairetu[i]==hairetu[i+1]:
        a = hairetu.pop(i+1)
    else:
        i=i+1

    
p = len(hairetu)
print(p)

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

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

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

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

Solution (Python):
n = int(input())
S = input()
ans = n
for i in range(len(S)-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())
a = list(input())
ans = 0

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

print(ans+1)

Solution (Python):

import sys














def main():
    n, s = sys.stdin.read().split()
    n = int(n)

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

if __name__ == "__main__":
    main()

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

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

Solution (Python):


n = int(input())
s = input()
ans = 0
l, r = 0, 0
while l < n:
    while r < n and s[l] == s[r]:
        r += 1
    if r <= l:
        r = l + 1
    ans += 1
    l = r

print(ans)

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

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

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

Solution (Python):
A=int(input())
B=input()
C=[]
for i in range(len(B)-1):
  if B[i]==B[i+1]:
    C.append(i+1)
print(len(B)-len(C))

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())
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()
current = ''
result = 0

for i in range(n):
    if not current == s[i]:
        result += 1
        current = s[i]
        
print(result)

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

b = ''
result = N
for s in input():
    if s == b:
        result -= 1
    b = s

print(result)

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

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

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

prev = S[0]
count = 1
for c in S[1:]:
    if c == prev:
        continue
    prev = c
    count += 1
print(count)

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

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

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

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

Solution (Python):
n = int(raw_input())
s = raw_input()
k = 0
c = None
for i in xrange(n):
  if s[i] == c:
    continue
  else:
    k += 1
    c = s[i]
print k

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())
S = stdin.readline().rstrip()

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

print(output)

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

s = ""
for i in range(N):
    if i == 0:
        s += S[i]
        continue
    if S[i-1] != S[i]:
        s += S[i]
print(len(s))