Harryxun/stf_run huggingface dataset:
import math
N=int(input())
a=list(map(int,input().split()))
a_=sorted(a,key=lambda x:-x)
ans=0
while len(a_)>1:#1になった時点で終わり。
    x,y=0,0
    t=int(math.log2(a_[0]))+1
    if 2**(t-1)==a_[0]:
    #これは、2,4,8とか2のべき乗だけが引っかかる条件
        if a_[0]==a_[1]:
        #2のべきでも、きちんと2個存在するならおｋ
            a_.remove(a_[0])
            a_.remove(a_[0])
            ans+=1
        else:
            a_.remove(a_[0])
    else:
        x+=a_[0]
        y+=2**t-a_[0]
        if y in a_:
        #上で被りうる奴は排除できている。
            ans+=1
            a_.remove(x)
            a_.remove(y)
        else:
            a_.remove(a_[0])
print(ans)

### FIXED CODE ###

from collections import Counter
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
c = Counter(a)

ans = 0
for i in a:
    if c[i] == 0:
        continue
    c[i] -= 1
    k = 1<<i.bit_length()
    j = k-i
    if j in c and c[j] > 0:
        ans += 1
        c[j] -= 1
print(ans)
a , b= raw_input(). split()
S = a * b
O = 2 * a + 2 * b

print str(S) + ' ' str(O)

### FIXED CODE ###

a , b= map(int,raw_input(). split())
S = a * b
O = 2 * a + 2 * b

print str(S) + ' ' +  str(O)
import numpy as np
a = int(input())
b = a % 10
hon = [2,4,5,7,9]
pon = [0,1,6,8]
bon = [3]
if b in hon:
    print("hon")
elif b in pon:
    print("pon")
else:
    print("bon")


### FIXED CODE ###

import numpy as np
a = int(input())
b = a % 10
hon = [2,4,5,7,9]
pon = [0,1,6,8]
bon = [3]
if b in hon:
    print("hon")
elif b in pon:
    print("pon")
else:
    print("bon")
intxt = input()
p = ""
ok = 0
for i in intxt:
  if i != p:
    ok += 1
  p = i
if ok == 2:
  print("Yes")
else:
  print("No)

### FIXED CODE ###

s = input()
if s[0] == s[1] and s[1] == s[2]:
  print("No")
else:
  print("Yes")
import numpy as np

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

players_score = np.array([k for i in range(n)])
for item in a:
    players_score -= 1
    players_score[item-1] += 1

indict = ['No' if i <= 0 else 'Yes' for i in players_score ]
for i in indict:
    print(i)




### FIXED CODE ###

import numpy as np

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

players_score = np.full(n, k-q)

for item in a:
    players_score[item-1] += 1

for i in players_score:
    if i <= 0:
        print("No")
    else:
        print("Yes")
num = [2,3,5]
M = 10**6; S = [0]*(M+2); S[1] = 1; s = 0;
for i in xrange(1,M+1):
    if S[i]==1:
        for j in xrange(3):
            S[min(M+1,num[j]*i)] = 1;
        s += 1
    S[i] = s
while 1:
    try:
        m,n = map(int, raw_input().split())
        print S[n]-S[m-1]
    except EOFError:
        break

### FIXED CODE ###

while 1:
    ipt = raw_input()
    if ipt=="0": break
    m,n = map(int, ipt.split())
    ans = 0
    for i in xrange(m,n+1):
        p = i
        while p>1:
            if p%2==0:
                p/=2
            elif p%3==0:
                p/=3
            elif p%5==0:
                p/=5
            else: break
        if p==1: ans+=1
    print ans
import math
x = int(input())
y = 10*10*10*10*10*10*10*10*10 +7
print(math.functional(x)%y)

### FIXED CODE ###

import math
x = int(input())
a = 10*10*10*10*10*10*10*10*10+7
print(math.factorial(x) % a)
l,r = input().split()
l = int(l)
r = int(r)
N = int(2019)
  
ans = (l * (l + 1)) % N
count = 0
for i in range(l,r-1):
  for j in range(l+1,r):
    if(count >= (N - 1)):
      flag = True
      break
    if(ans > (i * j) % N):
      ans = (i * j) % N
    count += 1
  if flag:
    break
    
print(ans)

### FIXED CODE ###

l,r = input().split()
l = int(l)
r = int(r)
N = int(2019)
  
ans = N
count = 0
right = min(l + N, r)
for i in range(l,right):
  for j in range(i+1,right+1):
    ans = min(ans, (i * j) % N)
    
print(ans)
n = -1
while n != 0:
	n = int(raw_input())
	a = [map(int,raw_input().split()) for i in xrange(n)]
	a = [l + [sum(l)] for l in a]
	a.append([sum([l[i] for l in a]) for i in xrange(len(a[0]))])
	print '\n'.join([''.join([str(i).rjust(5) for i in l]) for l in a])

### FIXED CODE ###

n = int(raw_input())
while n != 0:
	a = [map(int,raw_input().split()) for i in xrange(n)]
	a = [l + [sum(l)] for l in a]
	a.append([sum([l[i] for l in a]) for i in xrange(len(a[0]))])
	print '\n'.join([''.join([str(i).rjust(5) for i in l]) for l in a])
	n = int(raw_input())
x=sorted(input())
print(int(''.join(x[:-3:-1]))+int(x[0]))

### FIXED CODE ###

x=sorted(input().replace(' ',''))
print(int(''.join(x[:-3:-1]))+int(x[0]))
a = []
for i in range(3):
  a[i] = input()
print(a[0][0]+a[1][1]+a[2][2])

### FIXED CODE ###

a = []
for i in range(3):
  a.append(input())
print(a[0][0]+a[1][1]+a[2][2])
str = input()
ans = "Yes"
for i in len(str):
  if (i + 1) % 2 == 0 and str[i] not in ('L', 'U', 'D'):
    ans = "No"
  if (i + 1) % 2 == 1 and str[i] not in ('R', 'U', 'D'):
    ans = "No"

print(ans)

### FIXED CODE ###

str = input()
ans = "Yes"
for i in range(len(str)):
  if (i + 1) % 2 == 0 and str[i] not in ('L', 'U', 'D'):
    ans = "No"
  if (i + 1) % 2 == 1 and str[i] not in ('R', 'U', 'D'):
    ans = "No"
 
print(ans)
import math

a,b,x = map(int,input().split())

if x < a*a*b/2:
    print(90-math.degrees(math.atan(2*x/(a * (b**2)))))
    
else:
    print(90-math.degrees(math.atan(a**3 / (2*(a*a*b-x)))))


### FIXED CODE ###

import math

a,b,x = map(int,input().split())

if (a ==1 and b==1 and x ==1) or (a*a*b == x):
    print(0)    

elif x < a*a*b/2:
    print(90-math.degrees(math.atan(2*x/(a * (b**2)))))
    
else:
    print(90-math.degrees(math.atan(a**3 / (2*(a*a*b-x)))))
print("NO " if map(int, "".join(input().split())) % 4 else "YES")


### FIXED CODE ###

print("NO " if int("".join(input().split())) % 4 else "YES")
# -*- coding: utf-8 -*-

a=int(input())
b=int(input())

s=(a+b)*0.5

v=int(s)+1

print(v)



### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Nov  3 09:19:07 2018

@author: sk
"""

     
      
b, c = map(int, input().split())
     
s=0.5*(b+c)
     
d = int(s)
    
if s-d > 0:
    v=int(d+1)
else :
    v=int(d)
print(v)
def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

from itertools import groupby
N = int(input())
P = prime_decomposition(N)
ans = 0
for k, g in groupby(P):
    n = len(g)
    for i in range(1, 10000000):
        n -= i
        if n >=0:
            ans += 1
        else:
            break
print(ans)

        

### FIXED CODE ###

import sys
import time
st = time.perf_counter()
# ------------------------------


def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

from itertools import groupby
N = int(input())
P = prime_decomposition(N)
ans = 0
for k, g in groupby(P):
    n = len(list(g))
    for i in range(1, 10000000):
        n -= i
        if n >=0:
            ans += 1
        else:
            break
print(ans)

        
        



# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)
N, A, B, C = map(int, input().split())

take_list_global = []
for _ in range(N):
    take_list_global.append(int(input()))


abc = [A, B, C]

if A in take_list_global:
    take_list_global.remove(A)
    acb.remove(A)

if B in take_list_global:
    take_list_global.remove(B)
    abc.remove(B)

if C in take_list_global:
    take_list_global.remove(C)
    abc.remove(C)

if len(abc) == 0:
    print(0)


def combination(n: int) -> list:
    c = []
    for i in range(1<<n):
        if i == 0:
            continue
        l = []
        for j in range(n):
            if i&(1<<j) != 0:
                l.append(j)
        c.append(l)
    return c

from itertools import permutations
tar_lists = permutations(abc)

ans_list = []

for tar_list in tar_lists:
    
    ans = 0
    take_list = take_list_global.copy()
    
    for tar in tar_list:
        cost = 0
        com_lists = combination(len(take_list))
        min_abs = 1001
        min_com = []
        
        for com_list in com_lists:
            s = 0
            for c in com_list:
                s += take_list[c]
            if min_abs > abs(tar - s):
                min_abs = abs(tar - s)
                min_com = com_list

        del_take = []
        
        for c in min_com:
            del_take.append(take_list[c])

        for d in del_take:
            take_list.remove(d)

        cost += 10 * (len(min_com) - 1)
        cost += min_abs
        ans += cost

    ans_list.append(ans)

print(min(ans_list))

### FIXED CODE ###

N, A, B, C = map(int, input().split())
l = [int(input()) for _ in range(N)]
def dfs(cur, a, b, c):
  if cur == N:
    return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c) > 0 else 10**9
  ret0 = dfs(cur+1, a, b, c)
  ret1 = dfs(cur+1, a+l[cur], b, c) + 10
  ret2 = dfs(cur+1, a, b+l[cur], c) + 10
  ret3 = dfs(cur+1, a, b, c+l[cur]) + 10
  return min(ret0, ret1, ret2, ret3)

print(dfs(0,0,0,0))
N = int(input())
n = N // 7
flag = 0
for i in range(n + 1):
  if (N - n*7) % 4 == 0:
    print("Yes")
    flag = 1
    break:
if flag == 0:
  print("No")

### FIXED CODE ###

N = int(input())
n = N // 7
flag = 0
for i in range(n + 1):
  if (N - i*7) % 4 == 0:
    print("Yes")
    flag = 1
    break
if flag == 0:
  print("No")
import sys, math
def input():
    return sys.stdin.readline()[:-1]
from itertools import permutations, combinations
from collections import defaultdict, Counter
from math import factorial
from bisect import bisect_left # bisect_left(list, value)
#from fractions import gcd
from operator import mul
from functools import reduce

sys.setrecursionlimit(10**7)
n, a, b = map(int, input().split())
div = 10**9+7

l = [n]*(n)
for r in range(2, n+1):
    val = (n-r+1)/r
    l[r-1] = round(val*(l[r-2]))%div

l[a-1] = 0
l[b-1] = 0


print(sum(l))


### FIXED CODE ###

import sys, math
def input():
    return sys.stdin.readline()[:-1]
from itertools import permutations, combinations
from collections import defaultdict, Counter
from math import factorial
from bisect import bisect_left # bisect_left(list, value)
#from fractions import gcd
enu = enumerate

sys.setrecursionlimit(10**7)
n, a, b = map(int, input().split())
mod = 10**9 + 7

def cmb(n, r, p):
    r = min(n - r, r)
    if r == 0:
        return 1
    over = 1
    for i in range(n, n - r, -1):
        over = over * i % p
    under = 1
    for i in range(1, r + 1):
        under = under * i % p
    inv = pow(under, p - 2, p)
    return over * inv % p

cnt = pow(2, n, mod)
ng1 = cmb(n, a, mod)
ng2 = cmb(n, b, mod)

res = (cnt - ng1 - ng2 - 1) % mod

print(res)
n = int(input())
edges = {i: int(input())-1 for i in range(n)}
mem = [0 for _ in range(n)]
d = 0


def has_edge(edges, v, g, d):
    target = edges[v]
    if mem[v] == 0:
        mem[v] = 1
        if target == g:
            return d
        else:
            return has_edge(edges, target, g, d+1)
    return -2


print(has_edge(edges, 0, 1, d)+1)


### FIXED CODE ###

n = int(input())
edges = {i: int(input())-1 for i in range(n)}


def push_buttom(v, goal):
    for i in range(n):
        v = edges[v]
        if v == goal:
            return i+1
    return -1


print(push_buttom(0, 1))
import sys, collections
n = int(input())
a = [collections.deque(map(lambda x:int(x) - 1, input().split())) for _ in range(n)]
q = collections.deque()
pre_q = collections.deque()
day = 0


def check(p, q):
    if len(a[p]) == 0: return
    o = a[p][0]
    if a[o][0] == p:
        if p < o and not (p, o) in q:
            q.append((p, o))
        elif not (o, p) in q:
            q.append((o, p))

for p in range(n):
    check(p, q)

while len(q) > 0:
    day += 1
    pre_q = q.copy()
    q.clear()
    for (p, o) in pre_q:
        a[p].popleft()
        a[o].popleft()
        check(p, q)
        check(o, q)


for i in range(n):
    if len(a[i]) != 0:
        print(-1)
        sys.exit()

print(day)


### FIXED CODE ###

from collections import deque
import copy, sys

input = sys.stdin.readline
n = int(input())
a = [deque(map(lambda x: int(x) - 1, input().split())) for _ in range(n)]
q = deque()
pre_q = deque()
day = 0

def check(p, q):
    if not len(a[p]):
        return
    o = a[p][0]
    if p == a[o][0]:
        if p > o: p, o = o, p
        if not (p, o) in q:
            q.append((p, o))

fin = []
for p in range(n):
    if not p in fin:
        o = a[p][0]
        if p == a[o][0]:
            q.append((p, o))
            fin += [p, o]

while q:
    day += 1
    pre_q = copy.copy(q)
    q.clear()
    for (p, o) in pre_q:
        a[p].popleft()
        a[o].popleft()
        check(p, q)
        check(o, q)

if all(map(len, a)):
    print(-1)
else:
    print(day)
n,m=map(int,input().split())
from collections import defaultdict
a=list(map(int,input().split()))
dic={i:[2,5,5,4,5,6,3,7,6][i-1]for i in range(1,10)}
s={}
for i in a:
    if dic[i] in s:
        s[dic[i]]=max(s[dic[i]],i)
    else:
        s[dic[i]]=i
ok=list(s.items())#hon,digit
dp=[0]*(n+1)
for i in range(1,n+1):
    for h,d in ok:
        if h<=i:
            dp[i]=max(dp[i],dp[i-h]+1)
from operator import itemgetter as it 
ok.sort(reverse=1,key=it(1))
ans=''
now=n
keta=dp[n]
while keta>1:
    for h,d in ok:
        if now>h and dp[now]==dp[now-h]+1:
            ans+=str(d);now-=h;keta-=1;break
print(ans+str(s[now]))

### FIXED CODE ###

n,m=map(int,input().split())
from collections import defaultdict
a=list(map(int,input().split()))
dic={i:[2,5,5,4,5,6,3,7,6][i-1]for i in range(1,10)}
s={}
for i in a:
    if dic[i] in s:
        s[dic[i]]=max(s[dic[i]],i)
    else:
        s[dic[i]]=i
ok=list(s.items())#hon,digit
dp=[-float('inf')]*(n+1)
dp[0]=0
for i in range(1,n+1):
    for h,d in ok:
        if h<=i:
            dp[i]=max(dp[i],dp[i-h]+1)
from operator import itemgetter as it 
ok.sort(reverse=1,key=it(1))
ans=''
now=n
keta=dp[n]
while keta>1:
    for h,d in ok:
        if now>h and dp[now]==dp[now-h]+1:
            ans+=str(d);now-=h;keta-=1;break
print(ans+str(s[now]))
x,y = map(str,input().split())
dic = {10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"}
if x == y:
  print("=")
elif dic{x} > dic{y}:
  print(">")
else:
  print("<")


### FIXED CODE ###

x,y = map(str,input().split())
dic = {"A":10,"B":11,"C":12,"D":13,"E":14,"F":15}
if x == y:
  print("=")
elif dic[x] > dic[y]:
  print(">")
else:
  print("<")
N = int(input().rstrip)
count = 0
for i in N:
  if i == 7:
    count += 1
if count > 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N = input()
word = "7"
if word in N:
    print("Yes")
else:
    print("No")
x,k,d = map(int, input().split())
x = abs(x)
m = min(k,x//d)
x -= m*d
k -= m
if k%2: x = abs(x-d)
print(x)

### FIXED CODE ###

s = input()
for i in ['RRR','RR','R']:
    if i in s:
        print(len(i));break
else:
    print(0)
a = input()
b = input()
if int(a) * int(b) % 2 == 0:
    print("Even")
else:
    print("Odd")

### FIXED CODE ###

a,b = map(int,input().split())
if a * b % 2 == 0:
    print("Even")
else:
    print("Odd")
import heapq

N, K = map(int, input().split())
sushi = []

for _ in range(N):
    t, d = map(int, input().split())
    sushi.append((t, d))
sushi = sorted(sushi, key=lambda x: -x[1])

d_sushi = []  # 捨てる候補の寿司
heapq.heapify(d_sushi)  # リストaのheap化

fp = 0
tp = set()

for i in range(K):
    fp += sushi[i][1]
    if sushi[i][0] in tp:
        heapq.heappush(d_sushi, sushi[i][1])
    else:
        tp.add(sushi[i][0])
ans = fp+len(tp)**2

j = K
while d_sushi and len(tp) <= N:
    while sushi[j][0] in tp:
        j += 1
        if j == N:
            print(ans)
            exit()
    fp = fp-heapq.heappop(d_sushi)+sushi[j][1]
    tp.add(sushi[j][0])
    ans = max(ans, fp+len(tp)**2)

print(ans)


### FIXED CODE ###

import heapq

N, K = map(int, input().split())
sushi = []

for _ in range(N):
    t, d = map(int, input().split())
    sushi.append((t, d))
sushi = sorted(sushi, key=lambda x: -x[1])

d_sushi = []  # 捨てる候補の寿司
heapq.heapify(d_sushi)  # リストaのheap化

fp = 0
tp = set()

for i in range(K):
    fp += sushi[i][1]
    if sushi[i][0] in tp:
        heapq.heappush(d_sushi, sushi[i][1])
    else:
        tp.add(sushi[i][0])
ans = fp+len(tp)**2

if N == K:
    print(ans)
    exit()

j = K
while d_sushi and len(tp) <= N:
    while sushi[j][0] in tp:
        j += 1
        if j == N:
            print(ans)
            exit()
    fp = fp-heapq.heappop(d_sushi)+sushi[j][1]
    tp.add(sushi[j][0])
    ans = max(ans, fp+len(tp)**2)

print(ans)
S = input()
hug = 0
if len(S) % 2 == 0:
  for i in range(len(S/2)):
    if not S[i] == S[-i-1]:
      hug += 1
    else:
      pass
else:
  for i in range(int((len(S)+1)/2)):
    if not S[i] ==S[-i-1]:
      hug += 1
    else:
      pass
print(hug)
  

### FIXED CODE ###

S = input()
hug = 0
if len(S) % 2 == 0:
  for i in range(int(len(S)/2)):
    if not S[i] == S[-i-1]:
      hug += 1
    else:
      pass
else:
  for i in range(int((len(S)+1)/2)):
    if not S[i] ==S[-i-1]:
      hug += 1
    else:
      pass
print(hug)
n=int(input())
s=[None]*n
minv=100
for in range(n):
  s[i]=int(input())
  if minv>s[i]:
    if s[i]%10!=0:
      minv=s[i]
if minv==100:
  print(0)
elif sum(s)%10==0:
  print(sum(s)-minv)
else:
  print(sum(s))



### FIXED CODE ###

n=int(input())
s=[None]*n
minv=100
for i in range(n):
  s[i]=int(input())
  if minv>s[i]:
    if s[i]%10!=0:
      minv=s[i]
if minv==100:
  print(0)
elif sum(s)%10==0:
  print(sum(s)-minv)
else:
  print(sum(s))
K,X = input().split()
res=int(K)*500
if(res=>int(X)):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

K,X = input().split()
res=int(K)*500
if(res>=int(X)):
    print("Yes")
else:
    print("No")
from itertools import repeat

n, k, s = map(int, input().split())
print(*repeat(s, k), *repeat((s + 1) % 10**9, n - k))


### FIXED CODE ###

n, k, s = map(int, input().split())
print(*[s] * k + [(s + 1) % 10**9] * (n - k))
a=list(map(int,input().split()))
ans=min(a[0],a[3],a[4])
a[0]-=ans
a[3]-=ans
a[4]-=ans
ans*=3
if(ans>0&&(a[0]%2+a[3]%2+a[4]%2==2)):
  ans+=1
ans+=(a[0]//2*2)+(a[3]//2*2)+(a[4]//2*2)+a[1]
print(ans)


### FIXED CODE ###

a=list(map(int,input().split()))
ans=min(a[0],a[3],a[4])
a[0]-=ans
a[3]-=ans
a[4]-=ans
ans*=3
if(ans>0 and (a[0]%2+a[3]%2+a[4]%2==2)):
  ans+=1
ans+=(a[0]//2*2)+(a[3]//2*2)+(a[4]//2*2)+a[1]
print(ans)
n = int(input())
s, t = map(str, input().split())
for i in range(n):
  a = [].append(s[i])  
  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)
S=input()

def func(S):
    if S[:7]=="dreamer":
        return min(func(S[5:]),func(S[7:]))
    elif S[:6]=="eraser":
        return min(func(S[5:]),func(S[6:]))
    elif S[:5]=="dream":
        return func(S[5:])
    elif S[:5]=="erase":
        return func(S[5:])
    
    return len(S) 
    

if func(S)==0:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

S=input()

l=len(S)

while True:
    if S[-7:]=="dreamer":
        S=S[:-7] 
    elif S[-6:]=="eraser":
        S=S[:-6]
    elif S[-5:]=="dream":
        S=S[:-5]
    elif S[-5:]=="erase":
        S=S[:-5]

    if l==len(S):
        break
    else:
        l=len(S)


if l==0:
    print("YES")
else:
    print("NO")
import math
s = int(input())
for i in range(s):
    if math.sqrt(s - i).is_integer():
        print(s - i)
        break

### FIXED CODE ###

s = input()
l = input()
if s == l[::-1]:
    print("YES")
else:
    print("NO")
N = int(input())

card = list(map(int, input().split()))
sorted_card = card.sort(reverse=True)

Alice = 0
Bob = 0
for i in range(N):
  if i % 2 == 0:
    Alice += sorted_card[i]
  else:
    Bob += sorted_card[i]
    
print(Alice - Bob)

### FIXED CODE ###

N = int(input())
 
card = list(map(int, input().split()))
card.sort(reverse=True)
 
Alice = 0
Bob = 0
for i in range(N):
  if i % 2 == 0:
    Alice += card[i]
  else:
    Bob += card[i]
    
print(Alice - Bob)
#coding:utf-8
x=input()
print x**3

### FIXED CODE ###

import sys

x = int( sys.stdin.readline() )
print( "{}".format( x**3 ) )
S = input().lower
T = input().lower
for i in range(len(S)):
  S = S[len(S)-1:len(S)] + S[0:len(S)-1]
  if S == T:
    break
if S == T:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input().lower()
T = input().lower()
for i in range(len(S)):
  S = S[len(S)-1:len(S)] + S[0:len(S)-1]
  if S == T:
    break
if S == T:
  print("Yes")
else:
  print("No")
s = input().strip()
x,y = map(int,input().split())
AX = []
AY = []
flag = 0
cnt = 0
for i in range(len(s)):
    if s[i]=="F":
        cnt += 1
    else:
        if flag==0:
            AX.append(cnt)
            cnt = 0
            flag = 1
        else:
            AY.append(cnt)
            cnt = 0
            flag = 0
if cnt>0 and flag==0:
    AX.append(cnt)
if cnt>0 and flag==1:
    AY.append(cnt)
Nx = sum(AX)
dpX = [[0 for _ in range(2*Nx+1)] for _ in range(len(AX)+1)]
if s[0]=="F":
    dpX[0][0] = 1
    dpX[1][Nx+AX[0]] = 1
    for i in range(1,len(AX)):
        for j in range(2*Nx+1):
            if j+AX[i]<=2*Nx:
                dpX[i+1][j+AX[i]] = dpX[i+1][j+AX[i]] or dpX[i][j]
            if 0<=j-AX[i]:
                dpX[i+1][j-AX[i]] = dpX[i+1][j-AX[i]] or dpX[i][j]
else:
    dpX[0][Nx] = 1
    for i in range(len(AX)):
        for j in range(2*Nx+1):
            if j+AX[i]<=2*Nx:
                dpX[i+1][j+AX[i]] = dpX[i+1][j+AX[i]] or dpX[i][j]
            if 0<=j-AX[i]:
                dpX[i+1][j-AX[i]] = dpX[i+1][j-AX[i]] or dpX[i][j]
Ny = sum(AY)
dpY = [[0 for _ in range(2*Ny+1)] for _ in range(len(AY)+1)]
dpY[0][Ny] = 1
for i in range(len(AY)):
    for j in range(2*Ny+1):
        if j+AY[i]<=2*Ny:
            dpY[i+1][j+AY[i]] = dpY[i+1][j+AY[i]] or dpY[i][j]
        if 0<=j-AY[i]:
            dpY[i+1][j-AY[i]] = dpY[i+1][j-AY[i]] or dpY[i][j]
if Nx==0 and x!=0 or Ny==0 and y!=0:
    print("No")
elif dpX[len(AX)][Nx+x]==1 and dpY[len(AY)][Ny+y]==1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = input().strip()
x,y = map(int,input().split())
C = {}
cur = 0
cnt = 0
for i in range(len(s)):
    if s[i]=="F":
        cnt += 1
    else:
        C[cur] = cnt
        cur += 1
        cnt = 0
C[cur] = cnt
AX = []
AY = []
for a in C:
    if a>0 and a%2==0 and C[a]>0:
        AX.append(C[a])
    elif a%2==1 and C[a]>0:
        AY.append(C[a])
cntx = sum(AX)
dpx = [[0 for _ in range(2*cntx+1)] for _ in range(len(AX)+1)]
dpx[0][cntx] = 1
if cntx>0:
    dpx[1][cntx-AX[0]] = 1
    dpx[1][cntx+AX[0]] = 1
    for i in range(2,len(AX)+1):
        for j in range(-cntx,cntx+1):
            if -cntx<=j-AX[i-1]:
                dpx[i][j+cntx] = dpx[i-1][j-AX[i-1]+cntx]
                if j+AX[i-1]<=cntx:
                    dpx[i][j+cntx] = max(dpx[i][j+cntx],dpx[i-1][j+AX[i-1]+cntx])
            elif j+AX[i-1]<=cntx:
                dpx[i][j+cntx] = dpx[i-1][j+AX[i-1]+cntx]
cnty = sum(AY)
dpy = [[0 for _ in range(2*cnty+1)] for _ in range(len(AY)+1)]
dpy[0][cnty] = 1
if cnty>0:
    dpy[1][cnty-AY[0]] = 1
    dpy[1][cnty+AY[0]] = 1
    for i in range(2,len(AY)+1):
        for j in range(-cnty,cnty+1):
            if -cnty<=j-AY[i-1]:
                dpy[i][j+cnty] = dpy[i-1][j-AY[i-1]+cnty]
                if j+AY[i-1]<=cnty:
                    dpy[i][j+cnty] = max(dpy[i][j+cnty],dpy[i-1][j+AY[i-1]+cnty])
            elif j+AY[i-1]<=cnty:
                dpy[i][j+cnty] = dpy[i-1][j+AY[i-1]+cnty]
if C[0]-cntx<=x<=C[0]+cntx and dpx[len(AX)][x-C[0]+cntx]==1 and -cnty<=y<=cnty and dpy[len(AY)][y+cnty]==1:
    print("Yes")
else:
    print("No")
# coding:utf-8
n = int(input())
ans = 0

for a in range(n):
    ans += (n - 1) // a

print(ans)


### FIXED CODE ###

# coding:utf-8
n = int(input())
ans = 0

for a in range(1, n):
    ans += (n - 1) // a

print(ans)