Harryxun/stf_run huggingface dataset:
def tamiL(x,y,n):
  if (0 <= x < W) and (0 <= y < H):
    if grid[y][x] == ".":
      return tamiL(x-1,y,n+1)
    else:
      return n
  else:
    return n

def tamiR(x,y,n):
  if (0 <= x < W) and (0 <= y < H):
    if grid[y][x] == ".":
      return tamiR(x+1,y,n+1)
    else:
      return n
  else:
    return n

def tamiU(x,y,n):
  if (0 <= x < W) and (0 <= y < H):
    if grid[y][x] == ".":
      return tamiU(x,y-1,n+1)
    else:
      return n
  else:
    return n

def tamiD(x,y,n):
  if (0 <= x < W) and (0 <= y < H):
    if grid[y][x] == ".":
      return tamiD(x,y+1,n+1)
    else:
      return n
  else:
    return n

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

ans = 0
for i in range(H):
  for j in range(W):
    if grid[i][j] == ".":
      cnt = 0
      cnt += tamiL(j-1,i,0)
      cnt += tamiR(j+1,i,0)
      cnt += tamiU(j,i-1,0)
      cnt += tamiD(j,i+1,0)
      ans = max(ans,cnt+1)

print(ans)

### FIXED CODE ###

H,W = list(map(int,input().split()))
grid = [[i for i in input()] for i in range(H)]
cntH = [[0 for i in range(W)] for i in range(H)]
cntW = [[0 for i in range(W)] for i in range(H)]

for h in range(H):
  cnt = 0
  for w in range(W):
    if grid[h][w] == "#":
      cnt = 0
    else:
      cnt += 1
      cntW[h][w] = cnt

for h in range(H-1,-1,-1):
  cnt = 0
  for w in range(W-1,-1,-1):
    if grid[h][w] == "#":
      cnt = 0
    elif cnt == 0:
      cnt = cntW[h][w]
    else:
      cntW[h][w] = cnt

for w in range(W):
  cnt = 0
  for h in range(H):
    if grid[h][w] == "#":
      cnt = 0
    else:
      cnt += 1
      cntH[h][w] = cnt

for w in range(W-1,-1,-1):
  cnt = 0
  for h in range(H-1,-1,-1):
    if grid[h][w] == "#":
      cnt = 0
    elif cnt == 0:
      cnt = cntH[h][w]
    else:
      cntH[h][w] = cnt

ans = 0
for h in range(H):
  for w in range(W):
    ans = max(ans,cntW[h][w]+cntH[h][w])

print(ans-1)
S,T=map(str,input().split())
A,B=map(str,input().split())
U=str(input())
if U==S:
    A-=1
elif U==T:
    B-=1
print(A, B)


### FIXED CODE ###

S,T=map(str,input().split())
A,B=map(int,input().split())
U=str(input())
if U==S:
    A-=1
elif U==T:
    B-=1
print(A, B)
N = int(input())
L = list(map(int,input().split()))
D = {}
p = 0
for i in range(N) :
    if L[i] < 400 :
        color = 0
    elif L[i] < 800 :
        color = 1
    elif L[i] < 1200 :
        color = 2
    elif L[i] < 1600 :
        color = 3
    elif L[i] < 2000 :
        color = 4
    elif L[i] < 2400 :
        color = 5
    elif L[i] < 2800 :
        color = 6
    elif L[i] < 3200 :
        color = 7
    else :
        p += 1
    if color not in D :
        D[color] = 1
    else :
        D[color] += 1
ans1 = len(list(D.keys()))
ans2 = ans1 + p
print(ans1,ans2)


### FIXED CODE ###

N = int(input())
L = list(map(int,input().split()))
D = {}
p = 0
for i in range(N) :
    if L[i] < 400 :
        color = 0
    elif L[i] < 800 :
        color = 1
    elif L[i] < 1200 :
        color = 2
    elif L[i] < 1600 :
        color = 3
    elif L[i] < 2000 :
        color = 4
    elif L[i] < 2400 :
        color = 5
    elif L[i] < 2800 :
        color = 6
    elif L[i] < 3200 :
        color = 7
    else :
        p += 1
    if L[i] < 3200 :
        if color not in D :
            D[color] = 1
        else :
            D[color] += 1
ans1 = len(list(D.keys()))
q = 0
if ans1 == 0 :
    ans1 = 1
    q = 1
ans2 = ans1 + p - q
print(ans1,ans2)
n, k = map(int, input().split())
h_list = list(map(int, input().split()))
dp = [0]*n

for i in range(1,n):
    temp = []
    for j in range(1,min(k,i)+1):
        temp.append(dp[i-j]+abs(h_list[i]-h_list[i-j]))
        dp[i] = min(temp)

print(dp[n-1])

### FIXED CODE ###

from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
from fractions import gcd
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

n = int(input())
h_list = list(map(int, input().split()))
dp = [0]*n
dp[1] = abs(h_list[1]-h_list[0])

for i in range(2,n):
    dp[i] = min(dp[i-1]+abs(h_list[i]-h_list[i-1]), dp[i-2]+abs(h_list[i]-h_list[i-2]))

print(dp[n-1])
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math

mod = 10**9+7

N,M = map(int,input().split())
tree = [[] for i in range(N)]
for i in range(M):
    X,Y,Z = map(int,input().split())
    X -= 1
    Y -= 1
    tree[X] += [Y]
    tree[Y] += [X]

# print(tree)
used = [0 for i in range(N)]

def dfs(node,p):
    used[node] = 1
    # print(tree[node])
    for new in tree[node]:
        if new == p or used[new] == 1:continue
        dfs(new,node)

cnt = 0
while sum(used) < len(used):
    for i in range(N):
        if used[i] == 0:
            dfs(i,-1)
            cnt += 1

ans = N - (sum(used) - cnt)
print(ans)


### FIXED CODE ###

# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000


N,M = map(int,input().split())
tree = [[] for i in range(N)]
for i in range(M):
    X,Y,Z = map(int,input().split())
    X -= 1
    Y -= 1
    tree[X] += [Y]
    tree[Y] += [X]

# print(tree)
used = [0 for i in range(N)]

def dfs(node,p):
    used[node] = 1
    # print(tree[node])
    for new in tree[node]:
        if new == p or used[new] == 1:continue
        dfs(new,node)

cnt = 0
while sum(used) < len(used):
    for i in range(N):
        if used[i] == 0:
            dfs(i,-1)
            cnt += 1

ans = N - (sum(used) - cnt)
print(ans)
N,K = map(int,input().split())
import sys
sys.setrecursionlimit(10000000)

a, p = [1], [1]
for i in range(N):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)
def dfs(N,X):
    if N == 0:
        return 0 
    elif X <= 1 + a[N-1]:
        return dfs(N-1, X-1)
    elif X == 2 + a[N-1]:
        return p[N-1] + 1
    elif X <= 2 + 2*a[N-1]:
        return p[N-1] + 1 + dfs(N-1, X-2-a[N-1])
    else:
        2*p[N-1]+1
    
print(dfs(N,K))

### FIXED CODE ###

N,K = map(int,input().split())
import sys
sys.setrecursionlimit(10000000)

a, p = [1], [1]
for i in range(N):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)
def dfs(N,X):
    #print(N,X)
    if N == 0:
        return 0 if X != 1 else 1
    elif X <= 1 + a[N-1]:
        return dfs(N-1, X-1)
    elif X == 2 + a[N-1]:
        return p[N-1] + 1
    elif X <= 2 + 2*a[N-1]:
        return p[N-1] + 1 + dfs(N-1, X-2-a[N-1])
    else:
        return 2*p[N-1]+1
    
print(dfs(N,K))
s = input()
t = input()
ans = 0
for i in range(3):
if s[i] == t[i]:
  ans += 1
print(ans)

### FIXED CODE ###

s = input()
t = input()
ans = 0
for i in range(3):
	if s[i] == t[i]:
  		ans += 1
print(ans)
a,b,c=map(int,input.split());print(["No","Yes"][bool(bool(a==b+c)or(bool(b==a+c))or(bool(c==a+b)))])


### FIXED CODE ###

a,b,c=map(int,input().split());print(["No","Yes"][(a+b==c)+(b+c==a)+(c+a==b)])
import math

a, b, c, d = map(int, input().split())

lcm =  (c * d) // math.gcd(c, d)

ans = b - a + 1
ans -= (b // c) - ((a - 1 )// c)
ans -= (b // d) - ((a - 1) // d)
ans += (b // lcm) - ((a - 1) // lcm)
print(ans)
    


### FIXED CODE ###

from fractions import gcd

a, b, c, d = map(int, input().split())

lcm =  (c * d) // gcd(c, d)

ans = b - a + 1
ans -= (b // c) - ((a - 1 )// c)
ans -= (b // d) - ((a - 1) // d)
ans += (b // lcm) - ((a - 1) // lcm)
print(ans)
from itertools import combinations
n = int(input())
ans = 0
for i, j in list(combinations(list(map(int, input().split())), 2)):
    ans += i ^ j
print(ans % (10 ** 9 + 7))


### FIXED CODE ###

arr = list(map(int, input().split()))
ans = 'bust' if sum(arr) >= 22 else 'win'
print(ans)
from collections import deque

def num_way(stair):
  memo = ["EMPTY"]*(stair+1)
  def _fib(stair):
    if stair == 1 or stair == 0:
      return 1
    elif stair == 2:
      return 2
    elif memo[stair] != "EMPTY":
      return memo[stair]
    else:
      memo[stair] = _fib(stair-1)+_fib(stair-2)
      return memo[stair]
  return _fib(stair)

N, M = map(int,input().split())
a = deque([0])
path_poss = 1
ans = 1
for m in range(M):
  start = a.popleft()
  buff = int(input())
  end = buff-1
  if (end-start) <= -1:
    path_poss = 0
    break
  a.append(buff+1)
  ans *= num_way(end-start)
  ans %= 1000000007

if path_poss == 0:
  print(0)
else:
  start = a.popleft()
  end = N
  ans *= num_way(end-start)
  print(ans%1000000007)
  

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
from collections import deque

def num_way(stair):
  memo = ["EMPTY"]*(stair+1)
  def _fib(stair):
    if stair == 1 or stair == 0:
      return 1
    elif stair == 2:
      return 2
    elif memo[stair] != "EMPTY":
      return memo[stair]
    else:
      memo[stair] = _fib(stair-1)+_fib(stair-2)
      return memo[stair]
  return _fib(stair)

N, M = map(int,input().split())
a = deque([0])
path_poss = 1
ans = 1
for m in range(M):
  start = a.popleft()
  buff = int(input())
  end = buff-1
  if (end-start) <= -1:
    path_poss = 0
    break
  a.append(buff+1)
  ans *= num_way(end-start)
  ans %= 1000000007

if path_poss == 0:
  print(0)
else:
  start = a.popleft()
  end = N
  if(end-start) <= -1:
    path_poss = 0
  if path_poss == 0:
    print(0)
  else:
    ans *= num_way(end-start)
    print(ans%1000000007)
S=input()
N=len(S)
ren=[]
a=1
for i in range(N-1):
  if S[i]==S[i+1]:
    a+=1
  else:
    ren.append(a)
    a=1
  if i==N-2:
    ren.append(a)
      
M=len(ren)
ma=max(ren)
su=0
if S[0]=="<":
  if M%2==0:
    for k in range(M//2):
      if ren[2*k]<ren[2*k+1]:
        su=su+ren[2*k]*(ren[2*k]-1)//2+ren[2*k+1]*(ren[2*k+1]+1)//2
      else:
        su=su+ren[2*k]*(ren[2*k]+1)//2+ren[2*k+1]*(ren[2*k+1]-1)//2
  else:
    for k in range(M//2):
      if ren[2*k]<ren[2*k+1]:
        su=su+((ren[2*k]*(ren[2*k]-1))//2)+(ren[2*k+1]*(ren[2*k+1]+1)//2)
      else:
        su=su+ren[2*k]*(ren[2*k]+1)//2+ren[2*k+1]*(ren[2*k+1]-1)//2
    su+=ren[-1]*(ren[-1]+1)//2
if S[0]==">":
  su+=ren[0]*(ren[0]+1)//2  
  if (M-1)%2==0:
    for k in range((M-1)//2):
      if ren[1+2*k]<ren[1+2*k+1]:
        su=su+ren[1+2*k]*(ren[1+2*k]-1)//2+ren[1+2*k+1]*(ren[1+2*k+1]+1)//2
      else:
        su=su+ren[1+2*k]*(ren[1+2*k]+1)//2+ren[1+2*k+1]*(ren[1+2*k+1]-1)//2
  else:
    for k in range((M-1)//2):
      if ren[1+2*k]<ren[1+2*k+1]:
        su=su+ren[1+2*k]*(ren[1+2*k]-1)//2+ren[1+2*k+1]*(ren[1+2*k+1]+1)//2
      else:
        su=su+ren[1+2*k]*(ren[1+2*k]+1)//2+ren[1+2*k+1]*(ren[1+2*k+1]-1)//2
    su+=ren[-1]*(ren[-1]+1)//2
print(su)

### FIXED CODE ###

S=input()
N=len(S)
ren=[]
a=1
if N==1:
  print(1)
  exit()
for i in range(N-1):
  if S[i]==S[i+1]:
    a+=1
  else:
    ren.append(a)
    a=1
  if i==N-2:
    ren.append(a)
      
M=len(ren)
ma=max(ren)
su=0
if S[0]=="<":
  if M%2==0:
    for k in range(M//2):
      if ren[2*k]<ren[2*k+1]:
        su=su+ren[2*k]*(ren[2*k]-1)//2+ren[2*k+1]*(ren[2*k+1]+1)//2
      else:
        su=su+ren[2*k]*(ren[2*k]+1)//2+ren[2*k+1]*(ren[2*k+1]-1)//2
  else:
    for k in range(M//2):
      if ren[2*k]<ren[2*k+1]:
        su=su+((ren[2*k]*(ren[2*k]-1))//2)+(ren[2*k+1]*(ren[2*k+1]+1)//2)
      else:
        su=su+ren[2*k]*(ren[2*k]+1)//2+ren[2*k+1]*(ren[2*k+1]-1)//2
    su+=ren[-1]*(ren[-1]+1)//2
if S[0]==">":
  su+=ren[0]*(ren[0]+1)//2  
  if (M-1)%2==0:
    for k in range((M-1)//2):
      if ren[1+2*k]<ren[1+2*k+1]:
        su=su+ren[1+2*k]*(ren[1+2*k]-1)//2+ren[1+2*k+1]*(ren[1+2*k+1]+1)//2
      else:
        su=su+ren[1+2*k]*(ren[1+2*k]+1)//2+ren[1+2*k+1]*(ren[1+2*k+1]-1)//2
  else:
    for k in range((M-1)//2):
      if ren[1+2*k]<ren[1+2*k+1]:
        su=su+ren[1+2*k]*(ren[1+2*k]-1)//2+ren[1+2*k+1]*(ren[1+2*k+1]+1)//2
      else:
        su=su+ren[1+2*k]*(ren[1+2*k]+1)//2+ren[1+2*k+1]*(ren[1+2*k+1]-1)//2
    su+=ren[-1]*(ren[-1]+1)//2
print(su)
n = int(input())
l = list(map(int,input(),split()))

if max(l) < sum(l)-max(l):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N = int(input())
l = list(map(int, input().split()))
if 2 * max(l) < sum(l):
  print("Yes")
else:
  print("No")
N = int(input())
H = list(map(int, input().split()))
C = [ 0 for _ in range(N)]
r = 0
for i in range(N-1):
  if H[i]  H[i+1]:
    if i ==0:
      C[i] = 1
      continue
    C[i] = C[i-1] + 1
    if C[r] >=C[i]:
      r = i
print(r)


### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
c = 0
m = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    c +=1
  else:
    m = c if c>m else m
    c = 0
m = c if c>m else m
print(m)
n = int(input())
h = list(map(int, input().split()))

memo = [-1] * n
def cost(i):
  if i == 0:
    memo[i] = 0
  elif i == 1:
    memo[i] = abs(h[1] - h[0])
  else:
    if memo[i] == -1:
      cost1 = cost(i-2) + abs(h[i] - h[i-2])
      cost2 = cost(i-1) + abs(h[i] - h[i-1])
      memo[i] = min(cost1, cost2)
  return memo[i]
print(cost(n-1))

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))

cost = [0] * (n + 1)
cost[0] = 0
cost[1] = abs(h[1] - h[0])

for i in range(2, n):
  cost1 = cost[i-2] + abs(h[i] - h[i-2])
  cost2 = cost[i-1] + abs(h[i] - h[i-1])
  cost[i] = min(cost1, cost2)
print(cost[n-1])
n,m = map(int,input().split())
if abs(n - m) >= 2:
  print("0")
else:
  cou = 2
  while n > 1:
    cou *= n
    cou %= (10 ** 9 + 7)
    n -= 1
  while m > 1:
    cou *= m
    cou %= (10 ** 9 + 7)
    m -= 1
print(cou)

### FIXED CODE ###

n,m = map(int,input().split())
if abs(n - m) >= 2:
  print("0")
else:
  if n == m:cou = 2
  else:cou = 1
  while n > 1:
    cou *= n
    cou %= (10 ** 9 + 7)
    n -= 1
  while m > 1:
    cou *= m
    cou %= (10 ** 9 + 7)
    m -= 1
  print(cou)
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
N = int(input())
i = 0
j = 0
k = 0

while N > 0:
  dice = int(input())
  while i < 3:
    if A[i] == int(dice):
      A[i] = "z"
      i = i + 1
  while j < 3:
    if B[j] == dice:
      B[j] = "z"
      j = j + 1
  while k < 3:
    if C[k] == dice:
      C[k] = "z"
      k = k + 1
  N = N - 1
      
if A[0] == A[1] == A[2] == "z" or B[0] == B[1] == B[2] == "z" or C[0] == C[1] == C[2] == "z" or A[0] == B[0] == C[0] == "z" or A[1] == B[1] == C[1] == "z" or A[2] == B[2] == C[2] == "z" or A[0] == B[1] == C[2] == "z" or A[2] == B[1] == C[0] == "z":
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N = int(input())
if N / 2 == N // 2:
  print(int(N / 2))
else:
  print(int(N // 2 + 1))
# ABC_147_C_HonestOrUnkind2.py

N=int(input())
A=[]
for i in range(N):
    a=int(input())
    xy=[list(map(int, input().split())) for _ in range(a)]
    A.append([a,xy])
# print(A)

# 下からi桁目のbitが1->人iは正直
# 下からi桁目のbitが0->人iは不親切

ans=0
for i in range(2**N):
    for j in range(N):
        for k in range(A[j][0]):
            flag=0
            if (i >> j) & 1 != A[j][1][k][1]:
                flag=1
                break
        if flag==1:
                break
    else:
        # print(bin(i))
        ct=0
        for l in range(N):
            ct+=((i>>l)&1)
        ans=max(ans,ct)

print(ans)

### FIXED CODE ###

N = int(input())
A = []
for i in range(N):
    a = int(input())
    xy = [list(map(int, input().split())) for _ in range(a)]
    A.append([a, xy])
# print(A)

# 下からi桁目のbitが1->人iは正直
# 下からi桁目のbitが0->人iは不親切
# 不親切な人の証言は無視して良い

ans = 0
for i in range(2**N):
    for j in range(N):
        flag = 0
        if (i >> j) & 1:
            for k in range(A[j][0]):
                l = A[j][1][k][0]
                m=A[j][1][k][1]
                # print(i,j,k,(l,m),(i >> (l-1)))
                if not (i >> (l-1)) & 1 == A[j][1][k][1]:
                    flag = 1
                    break
            if flag == 1:
                break
    else:
        # print(bin(i))
        ct = 0
        for l in range(N):
            ct += ((i >> l) & 1)
        ans = max(ans, ct)
print(ans)
#coding:UTF-8

def RoT(A,B,ans):
    if A:
        root=A[0]
        rindex=B.index(root)
        Aleft=A[1:rindex+1]
        Aright=A[rindex+1:]
        Bleft=B[:rindex]
        Bright=B[rindex:]
        RoT(Aleft,Bleft,ans)
        RoT(Aright,Bright,ans)
        ans.append(root)
        
        


if __name__=="__main__":
    n=int(input())
    A=input().split(" ")
    B=input().split(" ")
    ans=[]
    RoT(A,B,ans)
    print(" ".join(ans))

### FIXED CODE ###

#coding:UTF-8

def RoT(A,B,ans):
    if A:
        root=A[0]
        rindex=B.index(root)
        Aleft=A[1:rindex+1]
        Aright=A[rindex+1:]
        Bleft=B[:rindex]
        Bright=B[rindex+1:]
        RoT(Aleft,Bleft,ans)
        RoT(Aright,Bright,ans)
        ans.append(root)
        
        


if __name__=="__main__":
    n=int(input())
    A=input().split(" ")
    B=input().split(" ")
    ans=[]
    RoT(A,B,ans)
    print(" ".join(ans))
s=input()
l=len(s)
print(x*l)

### FIXED CODE ###

s=input()
l=len(s)
print('x'*l)
# ABC126 D - Even Relation
# import sys
# sys.setrecursionlimit(20000000)

def dfs(node,distance):
    for next_node,edge_distangce in G[node]:
        if ans[next_node]==-1:
            ans[next_node] = (distance+edge_distangce)%2
            dfs(next_node,distance+edge_distangce)

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

for i in range(N-1):
    u,v,w = map(int,input().split())
    G[u-1].append([v-1,w])
    G[v-1].append([u-1,w])

ans = [-1]*N
dfs(0,0)
print(*ans,sep='\n')

### FIXED CODE ###

# ABC126 D - Even Relation
import sys
sys.setrecursionlimit(20000000)

def dfs(node,distance):
    for next_node,edge_distangce in G[node]:
        if ans[next_node]==-1:
            ans[next_node] = (distance+edge_distangce)%2
            dfs(next_node,distance+edge_distangce)

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

for i in range(N-1):
    u,v,w = map(int,input().split())
    G[u-1].append([v-1,w])
    G[v-1].append([u-1,w])

ans = [-1]*N
dfs(0,0)
print(*ans,sep='\n')
while True:
    a,b = map(int,input().split())
    if a ==0 and b ==0:
        break
    else:
        if a>=b:
        print(a,b)
        else:
        a,b =b,a
        print(a,b)


### FIXED CODE ###

while True:
    a,b = map(int,input().split())
    if a ==0 and b ==0:
        break
    else:
        if a<=b:
            print(a,b)
        else:
            a,b =b,a
            print(a,b)
A,B=map(int,input().split())
x=[1,2,3]
print(x[x!=A and x!=B])

### FIXED CODE ###

A = int(input())
B = int(input())
print(6-A-B)
N=int(input())
A=list(map(int,input().strip().split()))

A.sort(reverse=True)

cnt=0
for i in range(N-1):
    for j in reversed(range(i+1,N)):
        if A[i]%A[j]==0:
            cnt+=1
            break
if A[-1]%A[-2]==0:
    cnt+=1
print(N-cnt)

### FIXED CODE ###

def main():
    #input
    N=int(input())
    A=list(map(int,input().strip().split()))

    A.sort()

    l=[True for _ in range(A[-1]+1)]
    
    cnt=0
    for n in range(N-1):
        if l[A[n]]==True:
            if A[n]==A[n+1]:
                l[A[n]]=False
            else:
                l[A[n]]=False
                cnt+=1
            i=1
            while i*A[n]<=A[-1]:
                l[A[n]*i]=False
                i+=1
    if l[A[N-1]]==True:
        cnt+=1
        l[A[N-1]]=False
    return cnt

if __name__=="__main__":
    print(main())
n=int(input())
s=list(input().split())
if "Y" in s:
	print("Four")
else:
	print("Three")

### FIXED CODE ###

n=int(input())
print(n//3)
ab, bc, ca = map(int(i) for i in input().split)

print(ab * bc / 2)

### FIXED CODE ###

ab, bc, ca = map(int,input().split())

print(int(ab * bc / 2))
n = int(input())
s, t = map(str, input().split())
a = []
for i in range(n):
  a = a.append(s[i])  
  a = a.append(t[i])  

print("".join(a))  

### FIXED CODE ###

n = int(input())
s, t = map(str, input().split())
a = ''
for i in range(n):
  a += s[i] + t[i]
print(a)
import sys

sys.setrecursionlimit(10000)

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

already=0
def calc(update_list,value):
  for h,w in update_list:
    if maze[h][w]!=-1 and maze[h][w]<value:continue
    u=update(maze,h,w,value,[])
    calc(u,value+1)

update_list=update(maze,Ch-1,Cw-1,0,[])
calc(update_list,1)
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])
N=int(input())
S=input()

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

### FIXED CODE ###

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

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