Harryxun/stf_run huggingface dataset:
paper = [0,0,0,0,0,0,0,0,0,0]
N = int(input())
for _ in range(N):
    number = int(input())
    paper[number] += 1
sum = 0
for x in range(10)
    if paper[x] % 2 == 1
        sum += 1
print(sum)

### FIXED CODE ###

N = int(input())
if N+10 >= 100 or (N+1) % 10 == 0:
    print("Yes")
else:
    print("No")
N,X = map(int,input().split())
D = 0
ans = 1
for i in range(N):
    if D <=X:
        D+=int(input())
        ans+=1
    else:
        A =input())
        continue
if D >X:
    ans-=1
print(ans)

### FIXED CODE ###

N,X = map(int,input().split())
D = 0
ans = 1
L = list(x for x in input().split())
for i in range(N):
    
    if D <=X:
        D+=int(L[i])
        ans+=1
    else:
        continue
if D >X:
    ans-=1
print(ans)
#ABC044D
def fun(b,n):
    if n<b:return n
    return (n%b)+fun(b,n//b)
n=int(input())
s=int(input())
n_root=n**0.5

def main(n,n_root,s):
    if s==n:return n+1
    if s>n:return -1
    for b in range(2,1+int(n_root)):
        if fun(b,n)==s:
            return b
    for i in range(int(n_root),0,-1):
        b=1+(n-s)//i
        if fun(b,n)==s:
            if b>1:return b
    return -1
print(main(n,n_root,s))


### FIXED CODE ###

#ABC044D
def fun(b,n):
    if n<b:return n
    return (n%b)+fun(b,n//b)
n=int(input())
s=int(input())
n_root=n**0.5

def main(n,n_root,s):
    if s==n:return n+1
    if s>n:return -1
    if (n//2)+1<s:return -1
    for b in range(2,1+int(n_root)):
        if fun(b,n)==s:
            return b
    for i in range(int(n_root),0,-1):
        b=1+(n-s)//i
        if fun(b,n)==s:
            if b>1:return b
    return -1
print(main(n,n_root,s))
import numpy
h, w = map(int, input().split())
s = [input() for _ in range(h)]

dp = np.zeros(h * w).reshape(h, w)

if s[0][0] == "#":
    dp[0][0] = 1
else:
    dp[0][0] = 0
    
for i in range(h - 1):
    if s[i + 1][0] == "." or s[i][0] == s[i + 1][0]:
        dp[i + 1][0] = dp[i][0]
    else:
        dp[i + 1][0] = dp[i][0] + 1
for j in range(w - 1):
    if s[0][j + 1] == "." or s[0][j] == s[0][j + 1]:
        dp[0][j + 1] = dp[0][j]
    else:
        dp[0][j + 1] = dp[0][j] + 1

for i in range(h - 1):
    for j in range(w - 1):
        if s[i + 1][j + 1] == "." or (s[i][j + 1] == s[i + 1][j + 1] and s[i + 1][j + 1] == s[i + 1][j]):
            dp[i + 1][j + 1] = min(dp[i][j + 1], dp[i + 1][j])
        elif s[i][j + 1] == s[i + 1][j + 1] and s[i + 1][j + 1] != s[i + 1][j]:
            dp[i + 1][j + 1] = min(dp[i][j + 1], dp[i + 1][j] + 1)
        elif s[i][j + 1] != s[i + 1][j + 1] and s[i + 1][j + 1] == s[i + 1][j]:
            dp[i + 1][j + 1] = min(dp[i][j + 1] + 1, dp[i + 1][j])
        else:
            dp[i + 1][j + 1] = min(dp[i][j + 1] + 1, dp[i + 1][j] + 1)
    
if s[h - 1][w - 1] == "#" and (dp[h - 2][w - 1] != 1 and dp[h - 2][w - 1] != 1):
    dp[h- 1][w - 1] += 1

print(int(dp[h - 1][w - 1]))

### FIXED CODE ###

import numpy as np
h, w = map(int, input().split())
s = [input() for _ in range(h)]

dp = np.zeros(h * w).reshape(h, w)

if s[0][0] == "#":
    dp[0][0] = 1
else:
    dp[0][0] = 0
    
for i in range(h - 1):
    if s[i + 1][0] == "." or s[i][0] == s[i + 1][0]:
        dp[i + 1][0] = dp[i][0]
    else:
        dp[i + 1][0] = dp[i][0] + 1
for j in range(w - 1):
    if s[0][j + 1] == "." or s[0][j] == s[0][j + 1]:
        dp[0][j + 1] = dp[0][j]
    else:
        dp[0][j + 1] = dp[0][j] + 1

for i in range(h - 1):
    for j in range(w - 1):
        if s[i + 1][j + 1] == "." or (s[i][j + 1] == s[i + 1][j + 1] and s[i + 1][j + 1] == s[i + 1][j]):
            dp[i + 1][j + 1] = min(dp[i][j + 1], dp[i + 1][j])
        elif s[i][j + 1] == s[i + 1][j + 1] and s[i + 1][j + 1] != s[i + 1][j]:
            dp[i + 1][j + 1] = min(dp[i][j + 1], dp[i + 1][j] + 1)
        elif s[i][j + 1] != s[i + 1][j + 1] and s[i + 1][j + 1] == s[i + 1][j]:
            dp[i + 1][j + 1] = min(dp[i][j + 1] + 1, dp[i + 1][j])
        else:
            dp[i + 1][j + 1] = min(dp[i][j + 1] + 1, dp[i + 1][j] + 1)
  
# if h == 1 and w == 1:
#     if s[0][0] == "#":
#         dp[0][0] == 1
#     else:
#         dp[0][0] == 0
# elif h == 1:
#     if s[h - 1][w - 1] == "#" and (s[0][0] == "#" and dp[h - 1][w - 2] != 1):
#         dp[h- 1][w - 1] += 1
# elif w == 1:
#     if s[h - 1][w - 1] == "#" and (s[0][0] == "#" and dp[h - 2][w - 1] != 1):
#         dp[h- 1][w - 1] += 1
# else:
#     if s[h - 1][w - 1] == "#" and (s[0][0] == "#" and (dp[h - 2][w - 1] != 1 and dp[h - 1][w - 2] != 1)):
#         dp[h- 1][w - 1] += 1
        
# for i in range(w):
#     print(dp[0][i])

print(int(dp[h - 1][w - 1]))
import math
N,K = map(int,input().split())
blue = K
red = N-K
def permutations(n, r):
  if n == r:
    return 1
  else:
    return math.factorial(n) // math.factorial(n - r)

for i in range(1,K+1):
  ans = permutations(red+1,i)
  print(ans)

### FIXED CODE ###

import math
N,K = map(int,input().split())
blue = K
red = N-K
def combinations(n, r):
  if n == r:
    return 1
  else:
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(1,K+1):
  if i > N-K+1:
    print(0)
  else:
    ans = (combinations(red+1, i)*combinations(K-1, i-1))%(10**9+7)
    print(ans)
import sys

n,m,x,y = map(int, sys.stdin.readline().split())
x_list = list(map(int, sys.stdin.readline().split()))
y_list = list(map(int, sys.stdin.readline().split()))

x_max = max(x_list.append(x))
y_min = min(y_list.append(y))

if x < y
    print("No War")
else:
    print("War")

### FIXED CODE ###

N,M,X,Y = map(int,input().split())
x = max(X,max(list(map(int,input().split()))))
y = min(Y,min(list(map(int,input().split()))))
 
if y>x:
  print("No War")
else:
  print("War")
dic = {}
for i in xrange(97, 123):
  dic.setdefault(chr(i), 0)

input = "hoge"
while input != "":
  input = raw_input()
  for i in xrange(len(input)):
    if input[i].lower() in dic:
      dic[input[i].lower()] += 1

  # print dic
for i in xrange(97, 123):
  print chr(i) + " : " + str(dic[chr(i)])

### FIXED CODE ###

import sys

dic = {}
for i in xrange(97, 123):
  dic.setdefault(chr(i), 0)

line = ""
while True:
  try:
    temp = raw_input()
    # print "temp = " + temp
    if temp != "":
      line += temp
    else:
      break
  except:
    break

# print line

for i in xrange(len(line)):
  try:
    if line[i].lower() in dic:
      dic[line[i].lower()] += 1
  except TypeError:
    continue

  # print dic
for i in xrange(97, 123):
  print chr(i) + " : " + str(dic[chr(i)])
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, gcd
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]

def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def lcm(a, b):
    g = gcd(a, b)
    return a // g * b


def main():
    N = int(input())
    T = []
    for _ in range(N):
        T.append(int(input()))

    ans = 1
    for t in T:
        ans = lcm(ans, t)
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a // g * b


def main():
    N = int(input())
    t_list = list(sorted([int(input()) for _ in range(N)]))
    ans = 1
    for t in t_list:
        ans = lcm(ans, t)

    print(ans)

if __name__ == '__main__':
    main()
import sys

sys.setrecursionlimit(2000)

H,W=map(int,input().split())
Ch,Cw=map(int,input().split())
Dh,Dw=map(int,input().split())
maze=[]

for i in range(H):
  l=list(input())
  for j in range(len(l)):
    if l[j]=='.':l[j]=-1
    if l[j]=='#':l[j]=-2
  maze.append(l)
def isIn(h,w):
  if h<0 or h>=H or w<0 or w >=W:return False
  return True
def update(maze,h,w,value,l):
  global update_list
  vectors=[[-1,0],[1,0],[0,1],[0,-1]]
  maze[h][w]=value
  update_list=l
  u=[]
  for i in range(25):
    if not isIn(h+i//5-2,w+i%5-2):continue
    if maze[h+i//5-2][w+i%5-2]>maze[h][w] or maze[h+i//5-2][w+i%5-2]==-1:
      if [h+i//5-2,w+i%5-2] not in u:
        u.append([h+i//5-2,w+i%5-2])
        maze[h+i//5-2][w+i%5-2]=value+1
  for vector in vectors:
    if not isIn(h+vector[0],w+vector[1]):continue
    if maze[h+vector[0]][w+vector[1]]>maze[h][w] or maze[h+vector[0]][w+vector[1]]==-1:
      maze[h+vector[0]][w+vector[1]]=maze[h][w]
      update(maze,h+vector[0],w+vector[1],value,l)
      
  for h,w in u:
    if maze[h][w]==value+1 and not [h,w] in update_list:
      update_list.append([h,w])
  return update_list

def calc(update_list):
  for h,w in update_list:
    u=update(maze,h,w,maze[h][w],[])
    calc(u)

update_list=update(maze,Ch-1,Cw-1,0,[])
calc(update_list)

print(maze[Dh-1][Dw-1])

### FIXED CODE ###

from collections import deque
H,W=map(int,input().split())
Ch,Cw=map(int,input().split())
Dh,Dw=map(int,input().split())
maze=[]

for i in range(H):
  l=list(input())
  for j in range(len(l)):
    if l[j]=='.':l[j]=-1
    if l[j]=='#':l[j]=-2
  maze.append(l)

def isIn(h,w):
  if h<0 or h>=H or w<0 or w >=W:return False
  return True
l=[[Ch-1,Cw-1]]
l=deque(l)
maze[Ch-1][Cw-1]=0
l2=[[0]*W for i in range(H)]

cnt=0
while l:
  cnt+=1
  vectors=[[-1,0],[1,0],[0,1],[0,-1]]

  target=l[0]
  h,w=target
  l.popleft()
  if l2[h][w]:
    continue
  l2[h][w]=1
  for vector in vectors:
    if not isIn(h+vector[0],w+vector[1]):continue
    if maze[h+vector[0]][w+vector[1]]>maze[h][w] or maze[h+vector[0]][w+vector[1]]==-1:
      maze[h+vector[0]][w+vector[1]]=maze[h][w]
      l.appendleft([h+vector[0],w+vector[1]])
  for i in range(25):
    if not isIn(h+i//5-2,w+i%5-2):continue
    if maze[h+i//5-2][w+i%5-2]>maze[h][w] or maze[h+i//5-2][w+i%5-2]==-1:
      maze[h+i//5-2][w+i%5-2]=maze[h][w]+1
      l.append([h+i//5-2,w+i%5-2])
print(maze[Dh-1][Dw-1])
from matn import sqrt
N, P = map(int, input().split())
def prime_factorize(n):
    a = []
    N = n
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= N:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

lis = prime_factorize(P)
#print(lis)
if N == 1:
    print(P)
    exit()

else:
    d = [0] * (10 ** 6 + 5)
    for i in lis:
        if i != P:
            d[i] += 1
    #print(d[:24])
    #print(d[103])
    lis2 = []
    for i in reversed(range(10 ** 6 + 5)):
        if d[i] >= N:
            val = d[i] // N
            lis2.append(pow(i,val))
    ans = 1
    for i in lis2:
        ans *= i
    print(ans)


### FIXED CODE ###

from math import sqrt
N, P = map(int, input().split())
def prime_factorize(n):
    a = []
    N = n
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= N:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

lis = prime_factorize(P)
#print(lis)
if N == 1:
    print(P)
    exit()

else:
    d = [0] * (10 ** 7)
    sq = sqrt(P) + 1
    for i in lis:
        if i < sq:
            d[i] += 1
    #print(d[:24])
    #print(d[103])
    lis2 = []
    for i in reversed(range(10 ** 6 + 5)):
        if d[i] >= N:
            val = d[i] // N
            lis2.append(pow(i,val))
    ans = 1
    for i in lis2:
        ans *= i
    print(ans)
n=int(input())
flowers=[0]+list(map(int,input().split()))
ans=0
for i in range(1,n+1):
  ans+=max(flowers[i+1]-flowers[i],0)
print(ans)

### FIXED CODE ###

n=int(input())
flowers=[0]+list(map(int,input().split()))
ans=0
for i in range(n):
  ans+=max(flowers[i+1]-flowers[i],0)
print(ans)
n,a,b = map(int,input().split())
ans = a*(n//(a+b)) + min(N%(a+b),a)
print(ans)

### FIXED CODE ###

n,a,b = map(int,input().split())
ans = a*(n//(a+b)) + min(n%(a+b),a)
print(ans)
x,y = map(int,input().split())
 
if abs(y) > abs(x):
  if x > 0 and y > 0:
    print(y-x)
  elif x < 0 and y <0:
    print(abs(y)-abs(x)+2)
  else:
    print(abs(y)-abs(x)+1)
elif abs(y) < abs(x):
  if x > 0 and y > 0:
    print(ads(y-x+2))
  elif x < 0 and y <0:
    print(abs(y-x))
  else:
    print(abs(abs(y)-abs(x))+1)
else:
  if x == y:
    print("0")
  else:
    print("1")

### FIXED CODE ###

x,y = map(int,input().split())
 
if abs(y) > abs(x):
  if x >= 0 and y >= 0:
    print(y-x)
  elif x < 0 and y <0:
    print(abs(y)-abs(x)+2)
  else:
    print(abs(y)-abs(x)+1)
elif abs(y) < abs(x):
  if x > 0 and y > 0:
    print(x - y + 2)
  elif x <= 0 and y <=0:
    print(abs(abs(y)-abs(x)))
  else:
    print(abs(abs(y)-abs(x))+1)
else:
  if x == y:
    print("0")
  else:
    print("1")
flag = False
n = int(input())
t = [[0,0,0]]
for i in range(n):
    t.append( [int(x) for x in input().split()])
 
for  i in range(n):
    if (abs(t[i+1][1]-t[i][1])+abs(t[i+1][2]-t[i][2])) /  (t[i+1][0]-t[i][0]) > 1:
      		flag = False
            break
    elif (abs(t[i+1][1]-t[i][1])+abs(t[i+1][2]-t[i][2]))   / ( t[i+1][0]-t[i][0])  == 1:
            flag = True
            continue
    else:
            if not (( t[i+1][0]-t[i][0]) - (abs(t[i+1][1]-t[i][1])+abs(t[i+1][2]-t[i][2]))  )  &1:
                flag = True
                continue
            else:
              	flag = False
                break
if flag:
    print('Yes')
else:
    print('No')
    

### FIXED CODE ###

flag = False
n = int(input())
t = [[0,0,0]]
for i in range(n):
    t.append( [int(x) for x in input().split()])
 
for  i in range(n):
    if (abs(t[i+1][1]-t[i][1])+abs(t[i+1][2]-t[i][2])) /  (t[i+1][0]-t[i][0]) > 1:
            flag = False
            break
    elif (abs(t[i+1][1]-t[i][1])+abs(t[i+1][2]-t[i][2]))   / ( t[i+1][0]-t[i][0])  == 1:
            flag = True
            continue
    else:
            if not (( t[i+1][0]-t[i][0]) - (abs(t[i+1][1]-t[i][1])+abs(t[i+1][2]-t[i][2]))  )  &1:
                flag = True
                continue
            else:
                flag = False
                break
if flag:
    print('Yes')
else:
    print('No')
s = input()
s = list(s)
s2 = input()
s2 = list(s2)
D=0
count=1
for i in s2:
    if i==' ':continue
    D=D+int(i)
    if D<=int(s[2]):
        count+=1
print(count)

### FIXED CODE ###

s = input().split()
s = list(s)
s2 = input().split()
s2 = list(s2)
count=1
X = int(s[1])
count = 1
for i in s2:
    if i == ' ':
        continue
    X = X-int(i)
    if X < 0:
        break
    count += 1
print(count)
H, W = map(int, input().split())
M = [list(map(int, input().split())) for _ in range(H)]

for i in range(H):
  for j in range(W-1):
    if M[i][j] & 1:
      print(i+1, j+1, i+1, j+2)
      M[i][j+1] += 1
for i in range(H-1):
  if M[i][W-1] & 1:
    print(i+1, j+1, i+2, j+1)
    M[i+1][j] += 1


### FIXED CODE ###

H, W = map(int, input().split())
M = [list(map(int, input().split())) for _ in range(H)]

s = []
for i in range(H):
  for j in range(W-1):
    if M[i][j] & 1:
      s.append("{} {} {} {}".format(i+1, j+1, i+1, j+2))
      M[i][j+1] += 1
for i in range(H-1):
  if M[i][W-1] & 1:
    s.append("{} {} {} {}".format(i+1, W, i+2, W))
    M[i+1][W-1] += 1
print(len(s))
print("\n".join(s))
n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
fibo = [1,1]
r = [a[0]-1]

for i in range(m-1):
    r.append((a[i+1]-a[i])-2)
    if a[i+1] - a[i] == 1:
        print(0)
        exit()
else:
    r.append(n-a[-1]-1)

    for i in range(n):
        fibo.append((fibo[-1]+fibo[-2])%1000000007)

    ans = 1

    for i in range(len(r)):
        ans = (fibo[r[i]] * ans)%1000000007

    print(ans)

### FIXED CODE ###

n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
fibo = [1,1]
ans = 1

for i in range(n):
            fibo.append((fibo[-1]+fibo[-2])%1000000007)

if m:
    r = [a[0]-1]

    for i in range(m-1):
        r.append((a[i+1]-a[i])-2)
        if a[i+1]-a[i] == 1:
            print(0)
            exit()

    else:
        r.append(n-a[-1]-1)

        for i in range(len(r)):
            ans = (fibo[r[i]] * ans)%1000000007

        print(ans)
else:
    print(fibo[n])
N = int(input())
As = [int(input()) for _ in range(N)]

As.sort()
#print(As)

def f(As):
    Bs = [0] * N
    iB = N // 2
    d = -2
    for A in As[:N//2]:
    #    print(A, iB, d)
        Bs[iB] = A
        iB += d
        if d > 0:
            d = -d - 2
        else:
            d = -d + 2
#    print(Bs)

    if N % 2:
        iB = N // 2 + 1
        d = -2
    else:
        iB = N // 2 - 1
        d = +2
    for A in reversed(As[N//2:]):
        Bs[iB] = A
        iB += d
        if d > 0:
            d = -d - 2
        else:
            d = -d + 2
#    print(Bs)

    ans = 0
    for i in range(N - 1):
        ans += abs(Bs[i + 1] - Bs[i])
#    print(ans)
    return ans

print(max(f(As), f(As[::-1])))


### FIXED CODE ###

N = int(input())
As = [int(input()) for _ in range(N)]

As.sort(reverse=True)

if N % 2:
    ans = 2 * sum(As[:N//2 - 1]) - 2 * sum(As[N//2 + 2:])
    A1, A2, A3 = As[N//2 - 1:N//2 + 2]
    ans += max(A1 + A2 - 2*A3, 2*A1 - A2 - A3)
else:
    ans = 2 * sum(As[:N//2 - 1]) + As[N//2 - 1] - As[N//2] - 2 * sum(As[N//2 + 1:])

print(ans)
H, W = map(int, input().split(' '))
matrix = []
for _ in range(W):
    tmp = [0 if j == '.' else 1 for j in input()]
    matrix.append(tmp)

flag = 'Yes'
for i, row in enumerate(matrix):
    for j, s in enumerate(row):
        if s == 1:
            if (j > 0 and row[j-1] == 0) and (j < W - 1 and row[j+1] == 0):
                if (i > 0 and matrix[i-1][j] == 0) and (i < H - 1 and matrix[i+1][j] == 0):
                    flag = 'No'
        if flag == 'No':
            break

print(flag)


### FIXED CODE ###

H, W = map(int, input().split(' '))
matrix = []
for _ in range(H):
    tmp = [0 if j == '.' else 1 for j in input()]
    matrix.append(tmp)

flag = 'Yes'
for i, row in enumerate(matrix):
    for j, s in enumerate(row):
        if s == 1:
            if (j > 0 and row[j-1] == 0) and (j < W - 1 and row[j+1] == 0):
                if (i > 0 and matrix[i-1][j] == 0) and (i < H - 1 and matrix[i+1][j] == 0):
                    flag = 'No'
                    break

print(flag)
x, y = map(int,input().split())
if (x+y)%3!=0:
  print(0)
  exit()
n = (x+y)//3
if 0 > x-n or 0 > y-n:
  print(0)
  exit()

m = min(x-n,y-n)
mod = 1000000007
a=1
b=1

for i in range(1,m+1):
  a = a *(n+1-i) % mod
  b = b * i %mod
print(ans)
  


### FIXED CODE ###

#coding:utf-8
import bisect
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = True



def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]

    x, y = LMIIS()

    if (x+y)%3!=0:
      print(0)
      exit()
    n = (x+y)//3
    if 0 > x-n or 0 > y-n:
      print(0)
      exit()

    m = min(x-n,y-n)
    mod = 10**9 + 7

    a = 1
    b = 1
    c = 1
    for i in range(1, n+1):
        a = a * i % mod
    for i in range(1, n - m + 1):
        b = b * i % mod
    for i in range(1, m + 1):
        c = c * i % mod
    print(a * pow(b * c, mod - 2, mod) % mod)




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

### FIXED CODE ###

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)
import sys
import numpy as np
from collections import deque

h, w = map(int, input().split())
maze = [list(input()) for _ in range(h)]
direction = [(1, 0), (0, 1), (-1, 0), (0, -1)]

max_step = 0
for i in range(h):
    for j in range(w):
        largest_step = 0
#        print("start: ", i, j)
        if maze[i][j] == "#":
            continue
        visited = [[False] * w for _ in range(h)]
        distance = [[-1] * w for _ in range(h)]
        plan = deque()
        step = 0
        plan.appendleft((i, j, step))
        distance[i][j] = step
        visited[i][j] = True
        while plan:
            y, x, step = plan.pop()
            for next_direction in direction:
                next_y = y + next_direction[0]
                next_x = x + next_direction[1]
                if -1 == next_x or next_x == w or -1 == next_y or next_y == h or maze[next_y][next_x] == "#" or visited[next_y][next_x]:
                    continue
                distance[next_y][next_x] = distance[y][x] + 1
                visited[next_y][next_x] = True
                plan.appendleft((next_y, next_x, step + 1))
        max_step = max(max_step, np.max(np.array(distance)))

print(max_step)


### FIXED CODE ###

import sys
import numpy as np
from collections import deque

h, w = map(int, input().split())
maze = [list(input()) for _ in range(h)]
direction = [(1, 0), (0, 1), (-1, 0), (0, -1)]

max_step = 0
for i in range(h):
    for j in range(w):
        largest_step = 0
#        print("start: ", i, j)
        if maze[i][j] == "#":
            continue
        visited = [[False] * w for _ in range(h)]
        distance = [[-1] * w for _ in range(h)]
        plan = deque()
        step = 0
        plan.appendleft((i, j, step))
        distance[i][j] = step
        visited[i][j] = True
        while plan:
            y, x, step = plan.pop()
#            print(" ", x, y, step)
            # if step > largest_step:
            #     largest_step = step
            for next_direction in direction:
                next_y = y + next_direction[0]
                next_x = x + next_direction[1]
                if -1 == next_x or next_x == w or -1 == next_y or next_y == h or maze[next_y][next_x] == "#" or visited[next_y][next_x]:
                    continue
                distance[next_y][next_x] = distance[y][x] + 1
                visited[next_y][next_x] = True
                plan.appendleft((next_y, next_x, step + 1))
#        print(largest_step)
        # if largest_step > max_step:
        #     max_step = largest_step
        max_step = max(max_step, np.max(np.array(distance)))

print(max_step)
l = raw_input().split()

N = int(l[0])
X = int(l[1])

acc = []

for i in range(N):
    acc.append(int(raw_input()))
    print i

acc.sort()
first, rest = acc[0], acc[1:]

priceAmt = reduce(lambda x,y: x+y ,rest)
rem = X - priceAmt

size = rem / first

print size + len(rest)

### FIXED CODE ###

l = list(raw_input())

x1 = 100 if l[0] == "o" else 0
x2 = 100 if l[1] == "o" else 0
x3 = 100 if l[2] == "o" else 0

print 700+ x1 + x2 + x3
n,m=map(int,input().split())
s,t=set(),set()
for _ in range(m):
  a,b=map(int,input().split())
  if a==1:t.add(b)
  if b==n:s.add(a)
if s%t:print("POSSIBLE")
else:print("IMPOSSIBLE")

### FIXED CODE ###

n,m=map(int,input().split());a=[]
for i in range(m):
  aa,bb=map(int,input().split())
  if aa==1:a.append(bb)
  if bb==n:a.append(aa)
a.sort()
for i in range(len(a)-1):
  if a[i]==a[i+1]:print("POSSIBLE");exit()
print("IMPOSSIBLE")