Harryxun/stf_run huggingface dataset:
while True:
        try:
            list = [int(x) for x in raw_input().split(" ")]
            list.sort(lambda x, y: y - x)
            gcd = lcm = 0
            m = list[0]
            n = list[1]
            while True:
                r = m%n
                if r == 0:
                    gcd = n
                    break
                m = n
                n = r
            lcm = list[0] * list[1] / gcd
            print(str(gcd) + " " + str(lcm))
        except EOFError:
            break

### FIXED CODE ###

# -*- coding: utf-8 -*-
while True:
    try:
        list = [int(x) for x in raw_input().split(" ")]
        list.sort(lambda x, y: y - x)
        gcd = lcm = 0
        m = list[0]
        n = list[1]
        while True:
            r = m%n
            if r == 0:
                gcd = n
                break
            m = n
            n = r
        lcm = list[0] * list[1] / gcd
        print(str(gcd) + " " + str(lcm))
    except EOFError:
        break
case = input()
import numpy as np
case = np.array(case)
for i in range(len(case)):
  AC = 0
  WA = 0
  TLE = 0
  RE = 0
  others = 0
  if case[i] == "AC":
    AC += 1
  elif case[i] == "WA":
    WA += 1
  elif case[i] == "TLE":
    TLE += 1
  elif case[i] == "RE":
    RE += 1
  else :
    others += 1
  return AC, WA, TLE, RE, others
print("AC"+"x"+AC)
print("WA"+"x"+WA)
print("TLE"+"x"+TLE)
print("RE"+"x"+RE)

### FIXED CODE ###

N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
others = 0
for i in range(N):
  case = input()
  if case == "AC":
    AC += 1
      
  elif case == "WA":
    WA += 1
      
  elif case == "TLE":
    TLE += 1
      
  elif case == "RE":
    RE += 1
      
print("AC"+" x "+str(AC))
print("WA"+" x "+str(WA))
print("TLE"+" x "+str(TLE))
print("RE"+" x "+str(RE))
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N-2):
    for j in range(i+1,N-1):
        s = L[i] + L[j]
        ans += bs.bisect_left(L,s) - j - 1
        # bisect.bisect_left(list, x)
        # はリストにxを挿入できる点を返す
        # すなわち、
        # (val < x for val in list[0:i]) + (val >= x for val in list[i:len(list)])
print(ans)

### FIXED CODE ###

import bisect as bs
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N-2):
    for j in range(i+1,N-1):
        s = L[i] + L[j]
        ans += bs.bisect_left(L,s) - j - 1
        # bisect.bisect_left(list, x)
        # はリストにxを挿入できる点を返す
        # すなわち、
        # (val < x for val in list[0:i]) + (val >= x for val in list[i:len(list)])
print(ans)
n = int(input())
x = input()
flg = [0] * n
for i in range(n):
    if x[i] == '1':
        flg[i] = 1
x = int(x, 2)
cnt = sum(flg)
x_a = x % (cnt - 1)
x_b = x % (cnt + 1)


for i in range(n):
    if flg[i] == 1:
        t = (x_a - pow(2, n-i-1, cnt-1)) % (cnt - 1)
    else:
        t = (x_b - pow(2, n-i-1, cnt+1)) % (cnt + 1)

    if t == 0:
        print(1)
    else:
        tmp = 1
        while t > 0:
            pop = bin(t).count('1')
            t = t % pop
            tmp += 1

        print(tmp)


### FIXED CODE ###

n = int(input())
x = input()
flg = [0] * n
for i in range(n):
    if x[i] == '1':
        flg[i] = 1
x = int(x, 2)
cnt = sum(flg)
if cnt == 1:
    x_a = 0
else:
    x_a = x % (cnt - 1)
x_b = x % (cnt + 1)


for i in range(n):
    if flg[i] == 1:
        if cnt == 1:
            print(0)
            continue
        t = (x_a - pow(2, n-i-1, cnt-1)) % (cnt - 1)
    else:
        t = (x_b + pow(2, n-i-1, cnt+1)) % (cnt + 1)

    if t == 0:
        print(1)
    else:
        tmp = 1
        while t > 0:
            pop = bin(t).count('1')
            t = t % pop
            tmp += 1

        print(tmp)
from math import modf

n, a, b, c, d, e = [int(input()) for _ in range(6)]
r = [h for h in [a,b,c,d,e] if h != 1]
if 1 in [a,b,c,d,e]:
  r = min(r)-1
dd, ii = modf(n/min(r))

print(max(5, int(ii)+int(dd*10)))

### FIXED CODE ###

n, a, b, c, d, e = [int(input()) for _ in range(6)]
x = min(a,b,c,d,e)
print((n+x-1)//x+4)
input_line = input()
l = input().split(' ')
l = [int(x) for x in l]

if l[0] < i[1]:
  print(0)
else:
  print(10)

### FIXED CODE ###

input_line = input()
l = input_line.split(' ')
l = [int(x) for x in l]

if l[0] < l[1]:
    print(0)
else:
    print(10)
import math
def back_oturigation(fee, coin_values, coin_nums):
    """
    1. ?????????????????????????????????£??????????????????
    2. 1????????????????????????????????????????????????????????????
       ????????????§?????????????????????-> ??°?????????????????????¶???????????????????
    3. 2?????????????????????°?????????????????????????????????????????????
    """
    # 1.
    coin_values=np.array(coin_values)
    coin_nums=np.array(coin_nums)
    all = np.dot(coin_values, coin_nums)
    oturi = int(all - fee)

    use_coins = [0] * len(coin_values)
    no_use_coins = [0] * len(coin_values)
 
    # 2.
    for i in range(len(coin_values) - 1, -1, -1):
        no_use_coins[i] = int(oturi / coin_values[i])
        oturi = oturi - (coin_values[i] * no_use_coins[i])
 
    # 3.
    for i in range(0, len(use_coins), 1):
        use_coins[i] = coin_nums[i] - no_use_coins[i]
        if use_coins[i] > 0:
            print(str(coin_values[i]) + ' ' + str(use_coins[i]))
 
if __name__ == "__main__":
    first = True
    while (True):
        total_fee = int(input(''))
        if total_fee == 0:
            break
        if first:
            first = False
        else:
            print('')
        coins = input('')
        coins = coins.split(' ')  # 10, 50, 100, 500?????????§????????????
        coins = [int(coin) for coin in coins]
        coin_values = [10, 50, 100, 500]
        back_oturigation(total_fee, coin_values, coins)

### FIXED CODE ###

import math
def back_oturigation(fee, coin_values, coin_nums):
    """
    1. ?????????????????????????????????£??????????????????
    2. 1????????????????????????????????????????????????????????????
       ????????????§?????????????????????-> ??°?????????????????????¶???????????????????
    3. 2?????????????????????°?????????????????????????????????????????????
    """
    # 1.
    oturi = coin_values[0] * coin_nums[0] \
            + coin_values[1] * coin_nums[1] \
            + coin_values[2] * coin_nums[2] \
            + coin_values[3] * coin_nums[3] \
            - fee

    use_coins = [0] * len(coin_values)
    no_use_coins = [0] * len(coin_values)
 
    # 2.
    for i in range(len(coin_values) - 1, -1, -1):
        no_use_coins[i] = int(oturi / coin_values[i])
        oturi = oturi - (coin_values[i] * no_use_coins[i])
 
    # 3.
    for i in range(0, len(use_coins), 1):
        use_coins[i] = coin_nums[i] - no_use_coins[i]
        if use_coins[i] > 0:
            print(str(coin_values[i]) + ' ' + str(use_coins[i]))
 
if __name__ == "__main__":
    first = True
    while (True):
        total_fee = int(input(''))
        if total_fee == 0:
            break
        if first:
            first = False
        else:
            print('')
        coins = input('')
        coins = coins.split(' ')  # 10, 50, 100, 500?????????§????????????
        coins = [int(coin) for coin in coins]
        coin_values = [10, 50, 100, 500]
        back_oturigation(total_fee, coin_values, coins)
a, b, c, x, y = map(int, input().split())
if a+b<2*c:
    print(a*x+b*y)
else:
    if x > y:
        amari = x - y
        if a > 2*c:
            print(2*c*y + amari*2*c)
        else:
            print(2*c*y + amari*a)
    else:
        amari = y - x
        if b > 2*c:
            print(2*c*x + amari*2*c)
        else:
            print(2*c*x + 

### FIXED CODE ###

a, b, c, x, y = map(int, input().split())
if a+b<2*c:
    print(a*x+b*y)
else:
    if x > y:
        amari = x - y
        if a > 2*c:
            print(2*c*y + amari*2*c)
        else:
            print(2*c*y + amari*a)
    else:
        amari = y - x
        if b > 2*c:
            print(2*c*x + amari*2*c)
        else:
            print(2*c*x + amari*b)
def exhaustive_search(start, Sum, answer):
    for i in range(start, n):
        Sum = Sum + A[i]
        if Sum == answer:
            return True
        elif Sum > answer:
            Sum = Sum - A[i]
            next
        else:
            r = exhaustive_search(i+1, Sum, answer)
            if r == True:
                return True
            else:
                Sum = Sum - A[i]
    return False


for i in M:
    r = exhaustive_search(0, 0, i)
    if r == True:
        print('yes')
    else:
        print('no')
print('')

### FIXED CODE ###

def solve(dp, a, i, m):
  if m in dp[i]:
    return dp[i][m]

  if m == 0:
    dp[i][m] = True
  elif i >= len(a):
    dp[i][m] = False
  elif solve(dp, a, i+1, m):
    dp[i][m] = True
  elif solve(dp, a, i+1, m-a[i]):
    dp[i][m] = True
  else:
    dp[i][m] = False

  return dp[i][m]

N = int(input())
A = list(map(int, input().split()))
Q = int(input())
M = list(map(int, input().split()))

dp = {}
for i in range(N+1):
  dp[i] = {}

for m in M:
  if solve(dp, A, 0, m):
    print('yes')
  else:
    print('no')
n=int(input())
def di(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors
li=di(n)
a=li[-1]
b=li[-2]
if a**2==n:
    print(len(str(a)))
else:
    print(max(len(str(a)),len(str(b))))

### FIXED CODE ###

n=int(input())
def di(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors
li=di(n)
a=li[-1]
if a**2==n:
    print(len(str(a)))
elif n==1:
    print(1)
else:
    b=li[-2]
    print(max(len(str(a)),len(str(b))))
import math
import sys
import itertools
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = S()
x,y = IL()
N = len(s)

xlist = []
ylist = []

f = 0
cnt = 0
for i in range(N):
  if s[i] == "F":
    cnt += 1
  elif s[i] == "T":
    if f == 0:
      xlist.append(cnt)
      f = 1
    else:
      ylist.append(cnt)
      f = 0
    cnt = 0
else:
  if f == 0:
    xlist.append(cnt)
  else:
    ylist.append(cnt)

#print(xlist)
#print(ylist)

Xsum = sum(xlist)
Ysum = sum(ylist)

if (Xsum-x)%2 != 0:
  print("No")
  exit()
else:
  Xnum = (Xsum-x)//2
if (Ysum-y)%2 != 0:
  print("No")
  exit()
else:
  Ynum = (Ysum-y)//2

XDP = [[0]*(Xnum+2) for _ in range(len(xlist)+2)]
YDP = [[0]*(Ynum+2) for _ in range(len(ylist)+2)]

XDP[0][0] = 1
YDP[0][0] = 1

for i in range(1,len(xlist)+1):
  for j in range(Xnum):
    if XDP[i-1][j] == 1:
      XDP[i][j] = 1
      if j+xlist[i-1] < Xnum:
        XDP[i][j+xlist[i-1]] = 1
#print(XDP)
for i in range(1,len(ylist)+1):
  for j in range(Ynum):
    if YDP[i-1][j] == 1:
      YDP[i][j] = 1
      if j+ylist[i-1] < Ynum:
        YDP[i][j+ylist[i-1]] = 1
#print(YDP)
if XDP[-2][-2] == 1 and YDP[-2][-2] == 1:
  print("Yes")
else:
  print("No")
"""
FFTFFTFFFFTFFFFTFFTFFTFFFFTFFFFTFFTFF
2 2

FFFFFF
2 2
"""

### FIXED CODE ###

#import numpy as np
import math
import sys
import itertools
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = S()
x,y = IL()
N = len(s)

xlist = []
ylist = []

f = 0
cnt = 0
for i in range(N):
  if s[i] == "F":
    cnt += 1
  elif s[i] == "T":
    if f == 0:
      xlist.append(cnt)
      f = 1
    else:
      ylist.append(cnt)
      f = 0
    cnt = 0
else:
  if f == 0:
    xlist.append(cnt)
  else:
    ylist.append(cnt)

x -= xlist.pop(0)
Xsum = sum(xlist)
Ysum = sum(ylist)

if (Xsum-x)%2 != 0:
  print("No")
  exit()
else:
  Xnum = (Xsum-abs(x))//2
if (Ysum-y)%2 != 0:
  print("No")
  exit()
else:
  Ynum = (Ysum-abs(y))//2

#print(Xnum,Ynum)

XDP = [[0]*(abs(Xnum)+1) for _ in range(len(xlist)+1)]
YDP = [[0]*(abs(Ynum)+1) for _ in range(len(ylist)+1)]

XDP[0][0] = 1
YDP[0][0] = 1

for i in range(1,len(xlist)+1):
  for j in range(Xnum+1):
    if XDP[i-1][j] == 1:
      XDP[i][j] = 1
      if j+xlist[i-1] < Xnum+1:
        XDP[i][j+xlist[i-1]] = 1
#print(Xnum)
#print(xlist)
#print(XDP)

for i in range(1,len(ylist)+1):
  for j in range(Ynum+1):
    if YDP[i-1][j] == 1:
      YDP[i][j] = 1
      if j+ylist[i-1] < Ynum+1:
        YDP[i][j+ylist[i-1]] = 1
#print(Ynum)
#print(ylist)
#print(YDP)

if XDP[-1][-1] == 1 and YDP[-1][-1] == 1:
  print("Yes")
else:
  print("No")
t1, t2 = map(int, input().split())
a1, a2 = map(int, input().split())
b1, b2 = map(int, input().split())

sa = a1 * t1 + a2 * t2
sb = b1 * t1 + b2 * t2

if sa == sb:
	print("infinity")
	exit()

# a is faster
if sa < sb:
	a1, a2, b1, b2 = b1, b2, a1, a2
	sa, sb = sb, sa
delta = sa - sb

# no meeting
if a1 > b1:
	print(0)
	exit()

# count the meeting in T1 period
cnt = (b1 - a1) * t1 // delta

# count the meeting in T2 period
cnt += (b1 - a1) * t1 // delta + 1

# common one
if (b1 - a1) * t1 % delta == 0:
	cnt -= 1

print(cnt)

### FIXED CODE ###

t1, t2 = map(int, input().split())
a1, a2 = map(int, input().split())
b1, b2 = map(int, input().split())

sa = a1 * t1 + a2 * t2
sb = b1 * t1 + b2 * t2

if sa == sb:
	print("infinity")
	exit()

# a is faster
if sa < sb:
	a1, a2, b1, b2 = b1, b2, a1, a2
	sa, sb = sb, sa
delta = sa - sb

# no meeting
if a1 > b1:
	print(0)
	exit()

# count the meeting in T1 period
cnt = (b1 - a1) * t1 // delta

# count the meeting in T2 period
cnt += (b1 - a1) * t1 // delta + 1

# common one
if (b1 - a1) * t1 % delta == 0:
	cnt -= 1

print(cnt)
d = {"a": input(), "b": input(), "c": input()}

def func(s):
    if len(d[s]) == 0:
        return s.upper()
    next = d[s][0]
    d[s] = d[s][1:]
    return func(next)

print(func(a))

### FIXED CODE ###

d = {"a": input(), "b": input(), "c": input()}

def func(s):
    if len(d[s]) == 0:
        return s.upper()
    next = d[s][0]
    d[s] = d[s][1:]
    return func(next)

print(func("a"))
def main():
    N = input_int()
    S = input()

    print(len(rec(S)))


def rec(s):
    if len(s) <= 1:
        return s

    i = 0

    while i + 1 in range(len(s)) and s[i] == s[i+1]:
        i += 1

    return s[0] + rec(s[i+1:])


def input_int():
    return int(input())


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


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


main()


### FIXED CODE ###

def main():
    N = input_int()
    S = input()

    validitylist = [False] * N
    validitylist[0] = True

    for i in range(1, N):
        if S[i-1] != S[i]:
            validitylist[i] = True
    
    print(len([i for i in validitylist if i is True]))



def input_int():
    return int(input())


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


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


main()
n = input()

if n % 2 == 0:
    print(1 / 2)
else:
    print((((n - 1) / 2) + 1) / n)

### FIXED CODE ###

n = int(input())

if n % 2 == 0:
    print(1 / 2)
else:
    print((((n - 1) / 2) + 1) / n)
N,Q = [int(x) for x in input().split()]
ki = [0]*N
tr = [[] for _ in range(N)]

for i in range(N-1):
    a,b = [int(x)-1 for x in input().split()]
    tr[a].add(b)
    tr[b].add(a)

for i in range(Q):
    position,val = [int(x) for x in input().split()]
    ki[position-1] += val

stack =[1]
vivisted = set()

while stack:
    i = stack.pop()
    for j in tr[i]:
        if j in visited:
            continue
        visited.add(j)
        ki[j] += ki[i]
        stack.append(j)

for i in ki:
    print(i,end=" ")
print()


### FIXED CODE ###

N,Q = [int(x) for x in input().split()]
ki = [0]*N
tr = [[] for _ in range(N)]

for i in range(N-1):
    a,b = [int(x)-1 for x in input().split()]
    tr[a].append(b)
    tr[b].append(a)

for i in range(Q):
    position,val = [int(x) for x in input().split()]
    ki[position-1] += val

stack =[0]
visited = set()
visited.add(0)

while stack:
    i = stack.pop()
    for j in tr[i]:
        if j in visited:
            continue
        visited.add(j)
        ki[j] += ki[i]
        stack.append(j)

for i in ki:
    print(i,end=" ")
print()
N, x = list(map(int, input().split()))
li = sorted(list(map(int, input().split())))
res = 0
for i  in li:
    x -= i
    if x < 0:
        break
    else:
        res += 1
if x > 0:
    res -= 1

print(res)



### FIXED CODE ###

N, L = map(int, input().split())
lix = sorted(input() for i in range(N))

res = "".join(lix)
print(res)
#input
s = input()
t = input()

#output
m = len(s)
n = len(t)
dp = [[0]*(m+1) for _ in range(n+1)]

for i in range(n):
    for j in range(m):
        if s[i] == t[j]:
            dp[i+1][j+1] = dp[i][j]+1
        else:
            dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j])

ans = ""
while m > 0 and n > 0:
    if dp[m][n] == dp[m-1][n]:
        m -= 1
    elif dp[m][n] == dp[m][n-1]:
        n -= 1
    elif dp[m][n] == dp[m-1][n-1] + 1:
        ans += t[n-1]
        m -= 1
        n -= 1

print(ans[::-1])

### FIXED CODE ###

#input
s = input()
t = input()

#output
m = len(s)
n = len(t)
dp = [[0]*(m+1) for _ in range(n+1)]

for i in range(n):
    for j in range(m):
        if t[i] == s[j]:
            dp[i+1][j+1] = dp[i][j]+1
        else:
            dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j])

ans = ""
while m > 0 and n > 0:
    if dp[n][m] == dp[n-1][m]:
        n -= 1
    elif dp[n][m] == dp[n][m-1]:
        m -= 1
    elif dp[n][m] == dp[n-1][m-1] + 1:
        ans += t[n-1]
        n -= 1
        m -= 1

print(ans[::-1])
# _*_ coding:utf-8 _*_
#  Atcoder_Beginners_Contest118-C
#  https://atcoder.jp/contests/abc118/tasks/abc118_c
#  ref https://note.nkmk.me/python-gcd-lcm/
import math
from functools import reduce

def gcdList(lists):
	allGcd = reduce(math.gcd,lists)
	return allGcd

def solveProblem(PowerGauge):
	answer = gcdList(PowerGauge)
	return answer


if __name__ == '__main__':
	_ = int(input().strip())
	An = list(map(int,input().strip().split(' ')))
	solution = solveProblem(An)
	print("{}".format(solution))


### FIXED CODE ###

# _*_ coding:utf-8 _*_
#  Atcoder_Beginners_Contest118-C
#  https://atcoder.jp/contests/abc118/tasks/abc118_c
#  ref https://note.nkmk.me/python-gcd-lcm/

def gcd(small,big):
	if big < small:
		big,small = small,big
	if small == 0:
		return big
	else:
		return gcd(big % small,small)

def solveProblem(PowerGauge):
	nowGcd = 0
	for i in range(0,len(PowerGauge),+1):
		nowGcd = gcd(nowGcd,PowerGauge[i])
	answer = nowGcd
	return answer


if __name__ == '__main__':
	_ = int(input().strip())
	An = list(map(int,input().strip().split(' ')))
	solution = solveProblem(An)
	print("{}".format(solution))
N,K = map(int,input().split())
P = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = -float('inf')
for i in range(N):
    piece = i+1
    temp = 0
    hoge = []
    hogehoge = []
    key = 0
    for j in range(N):
        if j+1 > K:
            key = 1
            break
        piece = P[piece-1]
        temp += C[piece-1]
        hogehoge.append(C[piece-1])
        hoge.append(temp)
        if piece == i+1:
            break
    if key == 1:
        ans = max(ans,max(hoge))
    elif hoge[-1]<=0:
        ans = max(ans,max(hoge))
    else:
        d = K//len(hoge)
        r = K%len(hoge)
        peak = max(hoge[-1]*(d-1)+max(hoge[r:]),hoge[-1]*d+max(hoge[:r]))
        ans = max(ans,peak)
print(ans)


### FIXED CODE ###

N,K = map(int,input().split())
P = list(map(int,input().split()))
C = list(map(int,input().split()))

ans = -float('inf')
v = []
for n in range(N):
    loop, score = 0, 0
    t = n
    for i in range(min(N, K)):
        n = P[n]-1
        score += C[n]
        ans = max(ans, score)
        if n == t:
            loop = i+1
            break
    v.append((loop, score))

for n in range(N):
    loop, score = v[n]
    if loop > 0 and score > 0:
        r = (K-1)//loop
        nscore = r*score
        for i in range(K-r*loop):
            n = P[n]-1
            nscore += C[n]
            ans = max(nscore, ans)
print(ans)
n=int(input())
d=list(map(int,input().split()))

d=sorted(d)

print(d[n/2+1]-d[n/2-1])

### FIXED CODE ###

n = int(input())
d = sorted(list(map(int,input().split())))

print(d[n//2]-d[n//2-1])
N,X = map(int, input().split())

if N/2 == X:
    print(X*3)
else:
    # 上側
    l = X + N - X
    while X > 0:
        l += X*2
        X -= 1
    l += 1
print(l)

### FIXED CODE ###

N,X = map(int, input().split())

if N/2 == X:
    l = X*3
elif N/2 > X:
    l = N
    x = X
    n = N - X
    while x > 0:
        l += (n//x)*2*x
        c = x
        x = n%x
        n = c
    l -= n
else:
    l = N
    x = X
    n = N - X
    while x > 0:
        l += (n//x)*2*x
        c = x
        x = n%x
        n = c
    l -= n
print(l)
n, k = map(int, input().split())
s = int(input())

cnt = 0
for i in range(n):
    if s[i] != s[i+1]:
        cnt += 1
ans = min(count+2*k, n-1)
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
s = input()

cnt = 0
for i in range(n-1):
    if s[i] == s[i+1]:
        cnt += 1
ans = min(cnt+2*k, n-1)
print(ans)
n,x = map(int,input().split())
a = list(map(int,input().split()))
a = sorted(a)[::-1]
res = 0
p = 0
for i in a:
    x -= i
    if x < 0:
        x += i
        break
    res += 1
    p += 1
else:
    if x > 0:
        res -= 1
#print(p, a[p:])
print(res + (x in a[p:]))
t

### FIXED CODE ###

n,x = map(int,input().split())
a = sorted(list(map(int,input().split())))

res = 0
sum = 0
for i in a:
    res += 1
    sum += i
    if sum>=x:
        break
if sum==x:
    print(res)
else:
    print(res-1)
# -*- coding: utf-8 -*-

n, k, q =map(int, input().split())
a = []
a.append(map(int, [input() for i in range(q)]))

m = [k]*n

for i in range(a):
  for j in range(n):
    m[j]=m[j]-1
    m[a]=m[a]+1
  
for i in range(n):
  if m[n]>0:
    print(Yes)
  else:
    print(No)


### FIXED CODE ###

# -*- coding: utf-8 -*-
 
n, k, q =map(int, input().split())
a = [int(input()) for i in range(q)]

p = [0]*(n+1)

for i in range(q):
  p[a[i]] += 1
  

for i in range(1,n+1):
  if p[i]>q-k:
    print("Yes")
  else:
    print("No")
N = int(input())
A = [int(x) for x in input().split()]

ans = 0
r=0
xor_temp = 0
sum_temp = 0
for l in range(N):
	while r<N and (xor_temp^A[r] == sum_temp+A[r]):
		xor_temp = xor_temp^A[r]
		sum_temp = sum_temp+A[r]
		r += 1
	xor_temp = xor_temp^A[l]
	sum_temp = sum_temp-A[l]
	ans += r-l
print (ans)


### FIXED CODE ###

a, b = map(int,input().split())
sum=a+b
sub=a-b
mul=a*b
if (sum>sub):
    if (sum>mul):
        print(sum)
    else:
       print(mul)
else: 
    if (sub>mul):
        print(sub)
    else:
        print(mul)
S = input()
count = 0
if S == 'RSR':
  print(1)
else:
  for i in S:
    if i == 'R':
      cout+=1
  print(count)

### FIXED CODE ###

S = input()
count = 0
if S == 'RSR':
  print(1)
else:
  for i in S:
    if i == 'R':
      count+=1
  print(count)
a=input()
print(a**3)
sys.exit()

### FIXED CODE ###

a=int(input())
print(a**3)
import math

def myfact(n):
  return math.factorial(n) % 1000000007

def combinations_count(n, r):
    return (myfactorial(n) // ((myfactorial(n - r) * myfactorial(r))) % 1000000007

n, k = map(int, input().split())
for i in range(1, k+1):
  print(combinations_count(k-1, i-1) * combinations_count(i+1+(n-k)-(i-1)-1, (n-k)-(i-1)) % 1000000007) 

### FIXED CODE ###

import math

def myfactorial(n):
  return math.factorial(n)

def combinations_count(n, r):
  return (myfactorial(n) // (myfactorial(n - r) * myfactorial(r))) % 1000000007

n, k = map(int, input().split())
for i in range(1, k+1):
  if n-k+1 < i:
    print(0)
  else:
    print(combinations_count(k-1, i-1) * combinations_count(n-k+1, i) % 1000000007)
if __name__ == "__main__":
    S = input()
    for i in range(0, len(S), 2):
        if len(S) >= 2 :
            if S[i] == "h" and S[i+1] == "i":
                ret = "Yes"
            else:
                ret = "No"
                break
        else:
            ret = "No"
            break
    print(ret)


### FIXED CODE ###


if __name__ == "__main__":
    S = input()
    if len(S) % 2 == 0:
        for i in range(0, len(S), 2):
            if S[i] == "h" and S[i+1] == "i":
                ret = "Yes"
            else:
                ret = "No"
                break
    else:
        ret = "No"
    print(ret)