Harryxun/stf_run huggingface dataset:
s = input()
x,y = map(int,input().split())
k = 0
data = [[],[]]
f = 0
p = 1
for s_ in s:
    if p==1 and s_=='F':
        x -= 1
        continue
    p = 0
    if s_ == 'T':
        if f:
            data[k].append(f)
        k = (k+1)%2
        f = 0
    else:
        f += 1
if f:
    data[k].append(f)

nx = sum(data[0])
ny = sum(data[1])

dpx = [[0]*max((nx+2)*2,(x+1)*2) for _ in range(len(data[0])+1)]
dpy = [[0]*max((ny+2)*2,(y+1)*2) for _ in range(len(data[1])+1)]
dpx[0][(nx+1)//2] = 1
dpy[0][(ny+1)//2] = 1

for i in range(len(data[0])):
    for j in range(len(dpx[i])):
        if dpx[i][j]==1:
            dpx[i+1][j+data[0][i]] = 1
            dpx[i+1][j-data[0][i]] = 1

for i in range(len(data[1])):
    for j in range(len(dpy[i])):
        if dpy[i][j]==1:
            dpy[i+1][j+data[1][i]] = 1
            dpy[i+1][j-data[1][i]] = 1
if dpx[-1][(nx+1)//2+x]==1 and dpy[-1][(ny+1)//2+y]==1:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

now=0
idx=-1
data=[[],[]]
cnt=0
for s in input():
    if s=='F':
        cnt+=1
    elif s=='T':
        if idx==-1:
            now+=cnt
            cnt=0
            idx=1
        elif idx==0:
            data[0].append(cnt)
            cnt=0
            idx=1
        elif idx==1:
            data[1].append(cnt)
            cnt=0
            idx=0
if idx==-1:
    now+=cnt
else:
    data[idx].append(cnt)
def solve(target,move):
    dp={0,}
    for m in move:
        dpc=dp.copy()
        dp=set()
        for k in dpc:
            dp|={k-m,k+m}
    if target in dp:
        return True
    return False
x,y=map(int,input().split())
x-=now
if solve(x,data[0]) and solve(y,data[1]):
    print('Yes')
else:
    print('No')
# coding: utf-8

# https://atcoder.jp/contests/abc089/tasks/abc089_d
# 17:17-18:17 done


def main():
    H, W, D = map(int, input().split())
    A = [None] * H
    for i in range(H):
        A[i] = list(map(int, input().split()))
    Q = int(input())
    L, R = [None] * Q, [None] * Q
    for i in range(Q):
        L[i], R[i] = map(int, input().split())
        L[i] -= 1  # 1-index => 0-index
        R[i] -= 1  # 1-index => 0-index

    positions = [None] * (H*W)
    for i in range(H):
        for j in range(W):
            positions[A[i][j]-1] = (i, j)

    n_graph = D if D <= (H*W)//2 else (H*W)-D

    graphs = [[] for _ in range(n_graph)]

    for start in range(n_graph):
        cost = 0
        start_x, start_y = positions[start]
        m = 0
        while start + m*D < H*W:
            to_x, to_y = positions[start + m*D]
            cost += abs(to_x-start_x) + abs(to_y-start_y)
            graphs[start].append(cost)
            start_x, start_y = to_x, to_y
            m += 1
        
    for l, r in zip(L, R):
        graph_num = l % n_graph
        graph = graphs[graph_num]
        print(graph[r//D] - graph[l//D])


main()
# print(main())


### FIXED CODE ###

# coding: utf-8

# https://atcoder.jp/contests/abc089/tasks/abc089_d
# 17:17-18:17 read testcase
# 18:17-18:26 done


def main():
    H, W, D = map(int, input().split())
    A = [None] * H
    for i in range(H):
        A[i] = list(map(int, input().split()))
    Q = int(input())
    L, R = [None] * Q, [None] * Q
    for i in range(Q):
        L[i], R[i] = map(int, input().split())
        L[i] -= 1  # 1-index => 0-index
        R[i] -= 1  # 1-index => 0-index
    
    if D == H*W:
        for _ in range(Q):
            print(0)
        return None

    positions = [None] * (H*W)
    for i in range(H):
        for j in range(W):
            positions[A[i][j]-1] = (i, j)

    n_graph = D if D <= (H*W)//2 else (H*W)-D

    graphs = [[] for _ in range(n_graph)]

    for start in range(n_graph):
        cost = 0
        start_x, start_y = positions[start]
        m = 0
        while start + m*D < H*W:
            to_x, to_y = positions[start + m*D]
            cost += abs(to_x-start_x) + abs(to_y-start_y)
            graphs[start].append(cost)
            start_x, start_y = to_x, to_y
            m += 1

    for l, r in zip(L, R):
        graph_num = l % n_graph
        graph = graphs[graph_num]
        print(graph[r//D] - graph[l//D])


main()
# print(main())
import sys

sys.setrecursionlimit(10000)

s = input()
x, y = [int(x) for x in input().split()]

d = (
    (1, 0),
    (0, 1),
    (-1, 0),
    (0, -1),
)

def next_dr(dr):
    def fix(dr):
        if dr == -1:
            return 3
        if dr == 4:
            return 0
        return dr
    return fix(dr - 1), fix(dr + 1)

def next_dr_set(dr_set, l):
    if l == 0:
        return dr_set
    _next_dr_set = set()
    for dr in dr_set:
        _next_dr_set.update(set(next_dr(dr)))
    return next_dr_set(_next_dr_set, l - 1)

def next_dr_list(dr, l):
    dr_set = next_dr_set(set([dr]), l)
    return list(dr_set)

def _next_dr_list(dr, l):
    if l == 0:
        return [dr]
    if dr % 2 == 0:
        if l % 2 == 0:
            return [0, 2]
        else:
            return [1, 3]
    else:
        if l % 2 == 0:
            return [1, 3]
        else:
            return [0, 2]

def dfs(s, a, b, dr):
    # print("called")
    # print(s)
    # print(a)
    # print(b)
    # print(dr)
    if s == '':
        return x == a and y == b

    if s[0] == 'F':
        dx, dy = d[dr]
        a += dx
        b += dy
        return dfs(s[1:], a, b, dr)
    else:
        l = s.find('F')
        if l == -1:
            return x == a and y == b

        dr_list = _next_dr_list(dr, l)
        for next_dr in dr_list:
            if dfs(s[l:], a, b, next_dr):
                return True

        return False

ans = "Yes" if dfs(s, 0, 0, 0) else "No"
print(ans)


### FIXED CODE ###

import math
a, b = [int(x) for x in input().split()]
print(math.ceil((a + b) / 2))
from collections import defaultdict

n, q = map(int, input().split())
tree = defaultdict(list)
for _ in range(n-1):
    a, b = map(int, input().split())
    tree[a].append(b)
adds = [0]*(n+1)
for _ in range(q):
    p, x = map(int, input().split())
    adds[p] += x

res = [0]*(n+1)

def add_x(p, x):
    res[p] += x
    for child in tree[p]:
        add_x(child, x)

for i in range(1, n+1):
    add_x(i, adds[i])

print(' '.join(list(map(str, res[1:]))))

### FIXED CODE ###

import sys
from heapq import *
sys.setrecursionlimit(10**8)

input = sys.stdin.readline

tree = [[] for _ in range(200001)]
res = [0]*200001

def dfs(p, pre):
    for child in tree[p]:
        if child == pre: continue
        res[child] += res[p]
        dfs(child, p)

def main():
    """ main """
    N, Q = map(int, input().split())
    for _ in range(N-1):
        a,b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)
    for _ in range(Q):
        p,x = map(int, input().split())
        res[p] += x
    dfs(1, 0)

    print(*res[1:N+1])

if __name__ == '__main__':
    main()
i = list(map(int, input().split()))
    i.sort()
    if i[2] == i[0]+i[1]:
      print('Yes')
    else:
      print('No')

### FIXED CODE ###

a,b,c = map(int,input().split())
if a+b == c or b+c == a or c+a == b:
    print('Yes')
else:
    print('No')
import math
r = int(input())
print("%f %f" % (math.pi * r**2, math.pi * r * 2))

### FIXED CODE ###

import math
r = float(input())
print("%f %f" % (math.pi * r**2, math.pi * r * 2))
k,s=map(int,input().split())
cnt=0
for i in range(k+1):
    for j in range(k+1):
        z=s-i-j
        if z>=0 and z<=k:
            cnt+=1
print(cnt)

### FIXED CODE ###

s=input()
print(s.replace(","," "))
N, W = map(int, input().split())
L = sorted([list(map(int,input().split())) for i in range(N)])

dp = [0] * (W + 1)
con = 0

for w, v in L:
  con += w
  for i in range(min(con, W), w - 1, -1):
    if dp[i] < dp[i - w] + v:
      dp[i] = dp[i - w] + v

print(max(dp))

### FIXED CODE ###

import numpy as np

N , W = map(int,input().split())
dp = np.full(N * 1000 + 1,W + 1)
dp[0] = 0

for i in range(N):
  w,v = map(int,input().split())
  dp[v:] = np.minimum(dp[v:],dp[:-v] + w)

print(np.max(np.where(dp <= W)))
S = input()
Q = int(input())
for _ in range(Q):
    query = input().split()
    if len(query) == 1:
        S = S[::-1]
        # print('Ti=1: ' + S)
    else:
        F = int(query[1])
        C = query[2]
        if F == 1:
            S = ''.join([C, S])
        elif F == 2:
            S = ''.join([S, C])
        # print('Ti=2: ' + S)

print(S)

### FIXED CODE ###

S = set(input())
if len(S) == 2:
    print('Yes')
elif len(S) == 1:
    print('No')
import functools
import math

def blcm(x, y):
	return (x*y)//math.gcd(x, y)

def slcm(numbers):
	return functools.reduce(blcm, numbers)
	
input()
numbers=list(map(int, input().split()))
num=slcm(numbers)-1
nums=[num%i for i in numbers]
print(sum(nums))


### FIXED CODE ###

import functools
import fractions

def blcm(x, y):
	return (x*y)//fractions.gcd(x, y)

def slcm(numbers):
	return functools.reduce(blcm, numbers)
	
input()
numbers=list(map(int, input().split()))
num=slcm(numbers)-1
nums=[num%i for i in numbers]
print(sum(nums))
SA = input()
SB = input()
SC = input()

WIN = [0, 0, 0]



card = SA[0]

SA_CNT = 1
SB_CNT = 0
SC_CNT = 0

while True:
    if card == 'a':
        SA_CNT += 1
        if SA_CNT == len (SA):
            print('A')
            break
        else:
            card = SA[SA_CNT]
    if card == 'b':
        SB_CNT += 1
        if SB_CNT == len(SB):
            print('B')
            break
        else:
            card = SB[SB_CNT]
    if card == 'c':
        SC_CNT += 1
        if SC_CNT == len (SC):
            print('C')
            break
        else:
            card = SC[SC_CNT]

### FIXED CODE ###

SA = input()
SB = input()
SC = input()

card = SA[0]

SA_CNT = 1
SB_CNT = 0
SC_CNT = 0


while True:
    if card == 'a':
        if SA_CNT < len (SA):
            card = SA[SA_CNT]
            SA_CNT += 1
        else:
            print('A')
            break
    if card == 'b':
        if SB_CNT < len (SB):
            card = SB[SB_CNT]
            SB_CNT += 1
        else:
            print('B')
            break
    if card == 'c':
        if SC_CNT < len (SC):
            card = SC[SC_CNT]
            SC_CNT += 1
        else:
            print('C')
            break
S = input()
len_s = len(S)
L = 'AKIHABARA'

if S == L:
    print('YES')
    exit()
if len_s > 9:
    print('NO')
    exit()

S = [s for s in S]

for i in range(9):
    if S[i] == L[i]:
        pass
    elif S[i] == L[i+1]:
        S.insert(i, 'A')
    else:
        print('NO')
        exit()
    if i == 7:
        S.append('A')

S = ''.join(S)
if S == L:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

import re

S = input()
L = 'A?KIHA?BA?RA?$'

if re.match(L, S):
    print('YES')
else:
    print('NO')
n=int(input(""))
aa=input("").split(" ")
lista=[]
for i in range(n):
    lista+=[int(aa[i])]
s=0
lista.sort()
listde=set()
for i in range(n-1):
    if(lista[i]==lista[i+1]):
        listde.add(lista[i])
t=0
for i in range(n):
    t=0
    for k in listde:
        if (lista[i]%k==0):
            t=1
            break
    if (t==0):
        s+=1
        listde.ad(lista[i])
print(s)
    
        


### FIXED CODE ###

n=int(input(""))
aa=input("").split(" ")
lista=[]
for i in range(n):
    lista+=[int(aa[i])]
lista.sort()
listtf=[]
s=0
for i in range(lista[n-1]):
    listtf+=[True]
for i in range(n):
    
    if(listtf[lista[i]-1]):
        if(i<n-1 and lista[i]==lista[i+1]):
            s-=1
        s+=1
        t=1
        while(t*lista[i]<=lista[n-1]):
            listtf[lista[i]*t-1]=False
            t+=1
print(s)
from math import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)

N, X=map(int, input().split())
x=list(map(int, input().split()))
y=list()

for i in x:
    y.append(abs(X-i))

#print(y)
print(gcd_list(y))

### FIXED CODE ###

from fractions import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)

N, X=map(int, input().split())
x=list(map(int, input().split()))
y=list()

for i in x:
    y.append(abs(X-i))

#print(y)
print(gcd_list(y))
n,m = map(int,input().split())
num = [-1]*n
for i in range(m):
  s,c = map(int,input().split())
  if n!=1 and s==1 and c==0:
    print(-1)
    exit()
  if num[s-1]==-1: num[s-1] = c
  elif num[s-1]!=c:
    print(-1)
    eixt()
for i in range(n):
  if num[i] == -1: num[i] = 0
if num[0] == 0 and len(num)!=1: num[0] = 1
for i in range(n):
  print(num[i],end='')

### FIXED CODE ###

n,m = map(int, input().split())

num = 0
dic = {}

for i in range(m):
  s,c = map(int, input().split())
  if n!=1 and s==1 and c==0: 
    print(-1)
    exit()
  if s not in dic:
    dic[s] = c
    num = num + c*(10**(n-s))
  elif c!=dic[s]:
    print(-1)
    exit()

if 1 not in dic and n>1:
  num = num + 10**(n-1)

print(num)
n,m=map(int(input().split()))
if m=1:
    print(0)
else:
    print(m-n)

### FIXED CODE ###

n,m=map(int,input().split())
if m==1:
    print(0)
else:
    print(n-m)
S=input()
T=S[:N//2]
U=S[N//2+1:]
N=len(S)
flg=0

for i in range(int((N-1)/2)):
  if(S[i]!=S[-i-1]):
    print(S[i],S[-i])
    flg=1
    break
  
for j in range(len(T)//2):
  if(T[j]!=T[-j-1]):
    flg=1
    break
  
for k in range(len(U)//2):
  if(U[k]!=U[-k-1]):
    flg=1
    break

if(flg==0):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S=input()
N=len(S)
T=S[:N//2]
U=S[N//2+1:]

flg=0

for i in range(int((N-1)/2)):
  if(S[i]!=S[-i-1]):
    flg=1
    break
  
for j in range(len(T)//2):
  if(T[j]!=T[-j-1]):
    flg=1
    break
  
for k in range(len(U)//2):
  if(U[k]!=U[-k-1]):
    flg=1
    break

if(flg==0):
  print("Yes")
else:
  print("No")
#-*- coding:utf-8 -*-
x = input()
a = input()
b = input()

print((x-a)-b*((x-a)//b))

### FIXED CODE ###

#-*- coding:utf-8 -*-
x = int(input())
a = int(input())
b = int(input())

print((x-a)-b*((x-a)//b))
# スペース区切りの整数の入力
a, b = map(int, input().split())
# 判定
# 2で割った余りが0の時、Evenと出力
if (a * B)% 2 == 0:
  print('Even')
# 余りが0でないとき、Oddと出力
else:
  print('Odd)

### FIXED CODE ###

# スペース区切りの整数の入力
a, b = map(int, input().split())
# 判定
# 2で割った余りが0の時、Evenと出力
if (a * b)% 2 == 0:
  print('Even')
# 余りが0でないとき、Oddと出力
else:
  print('Odd')
N = input()
print("ABC" if N<=999 else "ABD")

### FIXED CODE ###

N = int(input())
print("ABC" if N<=999 else "ABD")
A,B = map(int,input().split)
X = A + B
Y = A - B
Z = A * B
if X - Y > 0 and X - Z > 0 : print(X)
elif Y - Z > 0 and Y - X > 0 : print(Y)
elif Z - X > 0 and Z - Y > 0 : print(Z)

### FIXED CODE ###

A,B = map(int,input().split())
X = A + B
Y = A - B
Z = A * B
if X >= Y and X >= Z:
     print(X)
elif Y >= Z and Y >= X:
     print(Y)
elif Z >= X and Z >= Y:
     print(Z)
import numpy as np

def main():
    input_string = list(map(int,input().split()))
    N = input_string[0]
    C = input_string[1]
    data = []
    for i in range(N):
        data.append(list(map(int,input().split())))

    data_np = np.array(data).reshape(N,3)

    max_time = max(data_np[:,1])
    schedule = np.zeros([max_time,C])

    for i in range(N):
        start = data[i][0]-1
        end = data[i][1]-1
        channel = data[i][2]-1
        for j in range(end-start+1):
            schedule[start+j][channel] = 1

    for c in range(C):
        for t in range(max_time):
            if t==0:continue
            if schedule[t][c]==1 and schedule[t-1][c]==0:
                schedule[t-1][c]=1

    max_N =0
    for t in range(max_time):
        sum_of_ch = sum(schedule[t])

        if sum_of_ch>max_N:
            max_N = int(sum_of_ch)
    print(max_N)







main()


### FIXED CODE ###

def main():
    input_string = list(map(int,input().split()))
    N = input_string[0]
    A = input_string[1]
    B = input_string[2]

    price1 = A*N
    price2 = B

    print(min(price1,price2))

main()
n,k = map(int,input().split())
a = [0]+list(map(int,input().split()))
t = [0]*(n+1)
l = [1]
t[1] = 1
x = 1
for i in range(n):
    if(t[a[x]] == 0):
        x = a[x]
        l.append(x)
    else:
        z = i+1
        break
print(l[k%z])

### FIXED CODE ###

n,k = map(int,input().split())
a = [0]+list(map(int,input().split()))
t = [0]*(n+1)
l = [1]
t[1] = 1
x = 1
y = 0
for i in range(n):
    if(t[a[x]] == 0):
        x = a[x]
        t[x] = 1
        l.append(x)
    else:
        z = i+1
        y = l.index(a[x])
        break
if(k>y):
    print(l[(k-y)%(z-y)+y])
else:
    print(l[k])
A = []
B = [0]*9

# Aには [1, 2, 3, 4, 5, 6, 7, 8, 9] の形で格納.
for _ in range(3):
    A += [int(i) for i in input().split()]

# 印をつけた数字をBに残しておく.
n=int(input())
for _ in range(n):
    b = int(input())
    for i, a in enumerate(A):
        if b == a:
            B[i] = 1

#ビンゴの可能性がある組を作っておく.
C = [[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7]]
flag = 0

# Bで1と記録が残っていれば真
for a,b,c in C:
    if B[a-1] and B[b-1] and B[c-1]:
        flag = 1
print('Yes' if Chk else 'No')

### FIXED CODE ###

import itertools
def main():
    A=[list(map(int,input().split())) for _ in range(3)]
    n=int(input())
    B=list(int(input()) for _ in range(n))
    B=sorted(B)
    C=itertools.combinations(B,3)
    if n<3:
        print('No')
        return
    
    ans=[]
    ans.append(sorted(A[0]))
    ans.append(sorted(A[1]))
    ans.append(sorted(A[2]))
    ans.append(sorted([a[0] for a in A]))
    ans.append(sorted([a[1] for a in A]))
    ans.append(sorted([a[2] for a in A]))
    ans.append(sorted([A[0][0],A[1][1],A[2][2]]))
    ans.append(sorted([A[0][2],A[1][1],A[2][0]]))
    for c in C:
        if list(c) in ans:
            print('Yes')
            return
    print('No')
    
main()
N, M = map(int, input().split())
L = [0] * M
R = [0] * M
L, R = map(int, input().split())
for i in range(M-1):
  l, r = map(int, input().split())
print(R-l+1)

### FIXED CODE ###

N,M = map(int,input().split())
L = []
R = []
for i in range(M):
    l,r = map(int,input().split())
    L.append(l)
    R.append(r)
ans = list(range(max(L),min(R)+1))
print(len(ans))
N = int(input())

print(N^**)

### FIXED CODE ###

N = int(input())

print(N**3)
A, B = [x for x in input().split()]

A = int(A)
B = int(round(float(B) * 100))

print(A*B // 100

### FIXED CODE ###

inp = input().split()

A = int(inp[0])
_B = float(inp[1])
B = round(_B * 100)

res = int(A*B // 100)

print(str(res))
from collections import deque

c = deque(input())
n = int(input())
head = 1

for _ in range(n):
  now = list(input().split())
  if now[0] == "1":
    head *= -1
  else:
    if now[1] == "1":
      if head == 1:
        c.appendleft(now[2])
      else:
        c.append(now[2])
    else:
      if head == 1:
        c.append(now[2])
      else:
        c.appendleft(now[2])
      
print("".join(c) if head == 1 else "".join(c[::-1]))

### FIXED CODE ###

from collections import deque

c = deque(input())
n = int(input())
head = 1

for _ in range(n):
  now = list(input().split())
  if now[0] == "1":
    head *= -1
  else:
    if now[1] == "1":
      if head == 1:
        c.appendleft(now[2])
      else:
        c.append(now[2])
    else:
      if head == 1:
        c.append(now[2])
      else:
        c.appendleft(now[2])
print("".join(c) if head == 1 else "".join([c.pop() for _ in range(len(c))]))
S = input()
K = int(input())

ans = set()

for i in range(len(S)):
    for j in range(len(S)+1):
        if (j-i)>=5:
            break
        if i==j:
            ans.add(S[i])
            continue
        if S[i:j]=="":
            continue
        ans.add(S[i:j])
ans = sorted(list(ans))
print(ans[K-1])


### FIXED CODE ###

S = input()
K = int(input())

ans = []
table ={}

for i in range(len(S)):
    for j in range(6):
        if i==j:
            s = S[i]
            if s in table:
                continue
            table[s] = 1
            ans.append(s)
            continue
        if S[i:i+j]=="":
            continue
        s = S[i:i+j]
        if s in table:
            continue
        table[s] = 1
        ans.append(s)

ans = sorted(ans)
print(ans[K-1])
from fractions import gcd
n, m = map(int, input().split())
s = list(input())
t = list(input())
if max(n, m) % min(n, m) == 0:
    print(-1)
else:
    i = 1
    lcm = n * m // gcd(n, m)
    while 1:
        a = [""] * (lcm * i)
        flag = True
        for j in range(n):
            a[lcm // n * j] = s[j]
        for k in range(m):
            if a[lcm // m * k] != "" and a[lcm // m * k] != t[k]:
                i += 1
                flag = False
                break
            a[lcm // m * k] = t[k]
        if flag:
            print(lcm * i)
            exit()


### FIXED CODE ###

from fractions import gcd
n, m = map(int, input().split())
s = list(input())
t = list(input())
i = 1
ans = n * m // gcd(n, m)
g = gcd(n, m)
for i in range(g):
    if s[i * n // g] != t[i * m // g]:
        ans = -1
        break
print(ans)
N=int(input())
A=list(map(int,input().split()))
if N==2:
    print(*A)
else:
    A=sorted(A)
    ans1=A[-1]
    del A[-1]
    saidai=ans1/2
    num=pow(10,9)
    for n in range(N-2):
        if abs(saidai-A[n])<=num:
            num=abs(saidai-A[n])
        else:
            ans2=n-1
    print(ans1,A[ans2])
    

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
sort_A=sorted(A)
max_A=sort_A[-1]
answer=[]
half_A=max_A//2
number=pow(10,9)
answer=0
for n in range(N-1):
    if number>=abs(sort_A[n]-half_A):
        answer=n
        number=abs(sort_A[n]-half_A)
print(max_A,sort_A[answer])
S = input()
S = list(S)
N = len(S)
count = 0

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

print(count)

### FIXED CODE ###

S = input()
S = list(S)
N = len(S)
count = 0

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

print(count)
import math

r = float(input())

s = r**2*math.pi
v = 2*math.pi*r

print("{0:.6f} {1:.6f}'.format(s, V))

### FIXED CODE ###

import math

r = float(input())

s = r*r*math.pi
v = 2*math.pi*r

S = round(s, 6)
V = round(v, 6)

print(S, V)
N,D = map(int,input().split())

row = list()
count = 0
for i in range(N):
  x = [int(_) for _ in input().split()]
  if i == 0:
    row.append(x)
  else:
    for j in len(row):
      dist = 0
      for k in range(D):
        dist += (row[j][k]-x[k])^2
      if (dist**1/2) == int:
      	count += 1
    row.append(x)
      
print(count)

### FIXED CODE ###

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

row = list()
count = 0
for i in range(N):
  x = [int(_) for _ in input().split()]
  if i == 0:
    row.append(x)
  else:
    for j in range(len(row)):
      dist = 0
      for k in range(D):
        dist += (row[j][k]-x[k])**2
      if (dist**0.5)-int(dist**0.5)==0:
      	count += 1
    row.append(x)
      
print(count)
def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors

N = int(input())
prime_list = prime_factors(N)
 
X = prime_list.pop(0)
Y = prime_list.pop(-1)
for L in prime_list:
    if X < Y:
        X = X*L
    else:
        Y = Y*L

if X >= Y:
    print(len(str(X)))
else:
    print(len(str(Y)))

### FIXED CODE ###

n = int(input())
ans = 1e9
for i in range(1,int(n**0.5)+1):
  if n % i == 0:
    ans = min( ans, max( len(str(i)), len(str(n//i)) ) )
print(ans)
if AAA or BBB:
  print(No)
else:
  print(Yes)

### FIXED CODE ###

S = input()
if S[0] == S[1] and S[1] == S[2]:
  print("No")
else:
  print("Yes")