Harryxun/stf_run huggingface dataset:
N = input()
n = len(list(N))
d_list = [9, 900, 90000]
if n >= 5:
  ans = 90909
elif n >= 4:
  ans = 909
elif n >= 3:
  ans = 9 + N % 1000
elif n >= 2:
  ans = 9
else:
  ans = N % 10
print(ans)

### FIXED CODE ###

N = int(input())
n = len(list(str(N)))
if n >= 6:
  ans = 90909
elif n >= 5:
  ans = 909 + (N - 9999)
elif n >= 4:
  ans = 909
elif n >= 3:
  ans = 9 + (N - 99)
elif n >= 2:
  ans = 9
else:
  ans = N
print(ans)
N,M = map(int, input().split())
A = sorted([int(i) for i in input().split()])
C = sorted([[int(i) for i in input().split()] for _ in range(M)],
           reverse=True, key=lambda x: x[1])
index = 0

for cnt, value in C:
    for _ in range(cnt):
        if A[index] >= value:
            break
        A[index] = value
        index += 1
print(sum(A))

### FIXED CODE ###

def check():
    N, M = map(int, input().split())
    A = sorted([int(i) for i in input().split()])
    sousa = sorted([[int(i) for i in input().split()] for i in range(M)],
                   reverse=True, key=lambda x:x[1])
    index = 0
    for cnt, value in sousa:
        for i in range(cnt):
            if index == N:
                break
            if A[index] < value:
                A[index] = value
            else:
                return(sum(A))
            index += 1
    return(sum(A))
print(check())
A,B,M=map(int,input().split())
vecA=list(map(int,input().split()))
vecB=list(map(int,input().split()))
matX=[input().split() for k in range(M)]
price = 10**6
for i in range(0,M):
    pricecom = int(vecA[int(matX[i][0]) -1]) + int(vecB[int(matX[i][1]) -1]) - int(matX[i][2])
    if pricecom<= price:
        price=pricecom
    else:
        pass
for m in range(M):
    for n in range (M):
        price2=int(vecA[m]) + int(vecB[n])
        if price2<=price:
            price=price2
print(price)

### FIXED CODE ###

A,B,M=map(int,input().split())
vecA=list(map(int,input().split()))
vecB=list(map(int,input().split()))
matX=[input().split() for k in range(M)]
price = 10**6
for i in range(0,M):
    pricecom = int(vecA[int(matX[i][0]) -1]) + int(vecB[int(matX[i][1]) -1]) - int(matX[i][2])
    if pricecom<= price:
        price=pricecom
    else:
        pass
price2=int(min(vecA)) + int(min(vecB))
if price2<=price:
    price=price2
print(price)
a, s =input().split()
a=int(a)

if a>=3200:
    print(s)
else:
    print('red')

### FIXED CODE ###

a = int(input())
s = input()

if a>=3200:
    print(s)
else:
    print('red')
n=int(input())
a = [int(input()) for i in range(n)]
for i in range(n):
  b=a
  del b[i]
  print(max(b))

### FIXED CODE ###

n=int(input())
a=[ int(input()) for i in range(n)]

b=sorted(a)

for i in range(n):
  if a[i] != b[-1]:
    print(b[-1])
  else:
    print(b[-2])
c = []
for _ in range(3):
    c.append(list(input().split()))
if c[0][0]+c[1][1]+c[2][2]] == c[0][0]+c[1][2]+c[2][1] and c[0][0]+c[1][2]+c[2][1] == c[0][1]+c[1][0]+c[2][2]:
    if c[0][1]+c[1][0]+c[2][2] == c[0][1]+c[1][2]+c[2][0] and c[0][1]+c[1][2]+c[2][0] == c[0][2]+c[1][0]+c[2][1]:
         if c[0][2]+c[1][0]+c[2][1] == c[0][2]+c[1][1]+c[2][0]:
             print("Yes")
else:
    print("No")


### FIXED CODE ###

c = []
for _ in range(3):
    c.append(list(map(int, input().split())))
A, B, C, D, E, F, G, H, I = c[0][0], c[0][1], c[0][2], c[1][0], c[1][1], c[1][2], c[2][0], c[2][1], c[2][2]

if max(A+E+I, A+F+H, B+D+I, B+F+G, C+D+H, C+E+G) == min(A+E+I, A+F+H, B+D+I, B+F+G, C+D+H, C+E+G):
    print("Yes")
else:
    print("No")
n=int(input())
s=input()
k=n
for i in range(n):
    a=s[:i]
    b=s[i+1:]
    l=a.count("W")+b.count("E")
    if l<k:
        k=l
print(k

### FIXED CODE ###

n=int(input())
s=input()
k=0
l=[]
for i in range(n):
    if s[i]=="W":
        k+=1
    l.append(k)
#print(l)
#既に追加されたものまで変更されはしなかった
w=n
for i in range(n):
    if i==0:
        #if s[i]=="W":
        #    v=n-l[n-1]+1
        #else:
        #    v=n-l[n-1]
        #下のようにすれば分ける必要はない
        v=n-1-l[n-1]+l[0]
    else:
        v=l[i-1]+n-1-i-(l[n-1]-l[i])


    if v<w:
        w=v
print(w)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

base = sum(B)
bonus = 0
for i, num in enumerate(A):
  if i+1 >= len(A):
    break
  if A[i+1] == A[i] + 1:
    bonus += C[i+1]

print(base + bonus)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

base = sum(B)
bonus = 0
for i, num in enumerate(A):
  if i + 1 >= len(A):
    break
  if A[i+1] == num + 1:
    bonus += C[num - 1]

print(base + bonus)
from sys import setrecursionlimit
from numpy import ceil


def _main():
    setrecursionlimit(1100)
    print int(sum(election(1.0, 1.0, input())))


def election(t_prev, a_prev, n):
    if n == 0:
        return t_prev, a_prev
    t, a = map(int, raw_input().split())

    mlt = max(ceil(t_prev / t), ceil(a_prev / a), 1)
    return election(t * mlt, a * mlt, n - 1)


if __name__ == '__main__':
    _main()

### FIXED CODE ###

inp = raw_input()
print len(set(inp.strip().split(' ')))
t=input()
s=[0]*len(t)
for i in range(len(t)):
  
  if t[i]=='?':
    if i==0:
      if t[i+1]=='D':s[i]='P'
      else:s[i]='D'
      
    if i==len(t)-1:s[i]='D'
    
    if s[i-1]=='P':s[i]='D'
    elif t[i+1]=='P':s[i]='D'
    else:s[i]='P'
  else:s[i]=t[i]
print(''.join(s))

### FIXED CODE ###

t=input()
s=[0]*len(t)

for i in range(len(t)):
  
    if t[i]=='?':
        if i==0:
            if len(t)>=2:
                if t[i+1]=='D':
                    s[i]='P'
                else:
                    s[i]='D'
            else:s[i]='D'
      
      
        elif i==len(t)-1:
            s[i]='D'
        
    
        else:
            if s[i-1]=='P':s[i]='D'
            elif t[i+1]=='P':s[i]='D'
            else:s[i]='P'

    elif t[i]=='D' or t[i]=='P':s[i]=t[i]
    else:continue
#print(s)
print(''.join(s))
N = int(input())
L_forward = 2
L_backward = 1
for i in range(2, N+1):
    L = L_forward + L_backward
    L_forward = L_backward
    L_backward = L
print(L)


### FIXED CODE ###

N = int(input())
L_forward = 2
L_backward = 1
if N == 1:
    print(L_backward)
else:
    for i in range(2, N+1):
        L = L_forward + L_backward
        L_forward = L_backward
        L_backward = L
    print(L)
X, Y = map(int, input())
print(X+Y//2)

### FIXED CODE ###

X, Y = map(int, input().split())
print(X+Y//2)
N=int(input())
T=1
for i in range(N):
    T1=int(input())
    t=gcd(T,T1)
    T=(T1//t)*(T//t)*t
print(T)


### FIXED CODE ###

from fractions import gcd
N=int(input())
T=1
for i in range(N):
    T1=int(input())
    t=gcd(T,T1)
    T=(T1//t)*(T//t)*t
print(T)
n = int(input())
a = list(map(int, input().split()))
m = []
for i in range(n - 2):
    if a[i] < a[i + 1] < a[i + 2] or a[i + 2] < a[i + 1] < a[i]:
        m.append(0)
    if a[i + 1] < a[i] < a[i + 2] or a[i + 1] < a[i + 2] < a[i]:
        m.append(1)
    if a[i] < a[i + 2] < a[i + 1] or a[i + 2] < a[i] < a[i + 1]:
        m.append(-1)

s = sum(abs(a[i] - a[i + 1]) for i in range(n - 1))

print(s - abs(a[0] - a[1]))
for i in m:
    if i == 0:
        print(s)
    elif i > 0:
        print(s - 2 * abs(a[i - 1] - a[i]))
    elif i < 0:
        print(s - 2 * abs(a[i] - a[i + 1]))
print(s - abs(a[n - 1] - a[n]))


### FIXED CODE ###

n = int(input())
a = [0] + list(map(int, input().split())) + [0]
m = []
for i in range(n):
    if a[i] <= a[i + 1] <= a[i + 2] or a[i + 2] <= a[i + 1] <= a[i]:
        m.append(0)
    elif a[i] <= a[i + 2] <= a[i + 1] or a[i + 1] <= a[i + 2] <= a[i]:
        m.append(1)
    elif a[i + 1] <= a[i] <= a[i + 2] or a[i + 2] <= a[i] <= a[i + 1]:
        m.append(-1)

s = sum(abs(a[i] - a[i + 1]) for i in range(n + 1))

for i, m0 in enumerate(m):
    if m0 == 0:
        print(s)
    elif m0 == 1:
        print(s - 2 * abs(a[i + 1] - a[i + 2]))
    elif m0 == -1:
        print(s - 2 * abs(a[i] - a[i + 1]))
(a, b, c) = [int(i) for i in input().sprit()]

count = 0

for i in range(a, b + 1)
    if c % i == 0
        count += 1


print(count)

### FIXED CODE ###

(a, b, c) = (int(i) for i in input().split())

count = 0

for i in range(a, b + 1) :
    if c % i == 0 :
        count += 1

print(count)
def main():
    input()
    t = list(map(int, input().split()))
    col = collections.Counter(t)
    com = {}
    al = 0
    for key in col:
        com[key] = combinations_count(col[key], 2)
        al += com[key]
    for v in t:
        c = col[v] - 1
        if c <= 1:
            c = 0
        else:
            c = combinations_count(c, 2)
        tmp = (al - com[v]) + c
        print(tmp)


if __name__ == '__main__':
    main()

### FIXED CODE ###


url = "https://atcoder.jp//contests/abc159/tasks/abc159_a"

def main():
    e, v = list(map(int, input().split()))
    lis = []
    for i in range(e):
        lis.append(1)
    for i in range(v):
        lis.append(2)
    count = 0
    for i in range(len(lis)):
        for j in range(i + 1, len(lis)):
            # print(lis[i], lis[j])
            if (lis[i] + lis[j]) % 2 == 0:
                count += 1
    print(count)

if __name__ == '__main__':
    main()
if input()='1':
    print(Hello World)
else input()=='2':
    A=int(input())
    B=int(input())
    print(A+B)

### FIXED CODE ###

N = int(input())
if N==1:
    print('Hello World')
else:
    A=int(input())
    B=int(input())
    print(A + B)
a=input()
if(a%2==0):
  ans=(a/2)**2
  return
else:
  ans=((a-1)/2)*((a+1)/2)
  return
print(ans)

### FIXED CODE ###

a=int(input())
if a%2==0:
  ans=int((a/2)**2)
else:
  ans=int(((a-1)/2)*((a+1)/2))
print(ans)
def mbisect(ok, ng):
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if check(mid):
            ok = mid
        else:
            ng = mid
    return ok


def check(mid):
    cnt = 0
    for i in a:
        cnt += (i + mid - 1) // mid - 1
    return cnt <= k


n, k = map(int, input().split())
a = tuple(map(int, input().split()))
print(mbisect(10 ** 9 + 1, -1))


### FIXED CODE ###

def mbisect(ok, ng):
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if check(mid):
            ok = mid
        else:
            ng = mid
    return ok


def check(mid):
    if mid == 0:
        return False
    cnt = 0
    for i in a:
        cnt += (i + mid - 1) // mid - 1
    return cnt <= k


n, k = map(int, input().split())
a = tuple(map(int, input().split()))
print(mbisect(10 ** 9, -1))
a = input()
if a < 1200:
    print("ABC")
else if a < 2800:
    print("ARC")
else:
    print("AGC")

### FIXED CODE ###

a = int(input())
if a < 1200:
 print("ABC")
elif a < 2800:
 print("ARC")
else:
 print("AGC")
a,b,c = [int(i) for i in input().split()]
k = int(input())
max = max(a,b,c)
tmp = a+b+c - max

for i in range(k):
    max = max*2

print(tmp+max)


### FIXED CODE ###

a,b = [int(i) for i in input().split()]
day = 0

if a <= b:
    day = a
else:
    day = a-1

print(day)
import math

def CntMultiples(a, b, n):
    return b//n - a//n + int(a%n==0)

A,B,C,D = map(int,input().split())
print(B-A+1-(CntMultiples(A, B, C) + CntMultiples(A, B, D) - CntMultiples(A, B, (C*D)//math.gcd(C, D))))

### FIXED CODE ###

import fractions
def CntMultiples(a, b, n):
    return b//n - a//n + int(a%n==0)

A,B,C,D = map(int,input().split())
print(B-A+1-(CntMultiples(A, B, C) + CntMultiples(A, B, D) - \
             CntMultiples(A, B, (C*D)//(fractions.gcd(C, D)))))
n,m = map(int,input().split())

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

count = [0]*(n+2)

mod = 10**9+7
if check[0]==1:
    count[0] = 1
    count[1] = 2
elif count[0] == 0:
    count[1] = 1

for i in range(1,n-1):
    if check[i+1] == 0:
        count[i+2] = count[i]%mod
    else:
        if check[i+1] == 1 or check[i+1] == 2:
            count[i+1] += count[i]%mod
        if check[i+2] == 1 or check[i+2] == 2:
            count[i+2] += count[i]%mod
    
print(count[n-1]%mod)

### FIXED CODE ###

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

check = [1]*(n+1)
check.append(0)
check.append(0)
for i in range(m):
    a = int(input())
    check[a] = 0
    

count = [0]*(n+2)

mod = 10**9+7
if check[0]==1:
    count[0] = 1
    
elif count[0] == 0:
    count[1] = 1

for i in range(1,n+2):
    count[i] += count[i-1] + count[i-2]
    count[i] %= mod
    if check[i] == 0:
        count[i] = 0
    
    
print(count[n]%mod)
def num_to_match(n):
    if n == 1:
        return 2
    elif n == 7:
        return 3
    elif n == 4:
        return 4
    elif n in [2, 3, 5]:
        return 5
    elif n in [6, 9]:
        return 6
    else:
        return 7


def match_to_max_num(m, A):
    if m == 2:
        return 1
    elif m == 3:
        return 7
    elif m == 4:
        return 4
    elif m == 5:
        return max(set({2, 3, 5}).intersection(set(A)))
    elif m == 6:
        return max(set({6, 9}).intersection(set(A)))
    else:
        return 8


def find_opt_match(N, match):
    match_list = [0 for _ in range(N)]
    def dfs(cur, rest, m=0):
        if rest < m:
            return False
        if rest == m:
            match_list[cur] = m
            return True
        for mm in match:
            if dfs(cur + 1, rest - m, mm):
                if cur >= 0:
                    match_list[cur] = m
                return True
        return False
    dfs(-1, N)
    return match_list[:match_list.index(0)]


def main():
    N, M = list(map(int, input().split(' ')))
    A = list(map(int, input().split(' ')))
    match = list(map(num_to_match, A))
    match.sort()
    opt_match = find_opt_match(N, match)
    opt_num = list(map(lambda x: match_to_max_num(x, A), opt_match))
    opt_num.sort()
    ans = 0
    pw = 1
    for n in opt_num:
        ans += n * pw
        pw *= 10
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def num_to_match(n):
    if n == 1:
        return 2
    elif n == 7:
        return 3
    elif n == 4:
        return 4
    elif n in [2, 3, 5]:
        return 5
    elif n in [6, 9]:
        return 6
    else:
        return 7


def max_length(N, match):
    match = set(match)
    INF = 10**15
    dp = [- INF for _ in range(N + 1)]
    dp[0] = 0
    for n in range(1, N + 1):
        max_l = dp[n]
        for m in match:
            if n - m >= 0 and dp[n - m] >= 0:
                max_l = max([max_l, 1 + dp[n - m]])
        dp[n] = max_l
    return dp


def main():
    N, _ = list(map(int, input().split(' ')))
    A = list(map(int, input().split(' ')))
    A.sort(reverse=True)
    match = list(map(num_to_match, A))
    max_l = max_length(N, match)
    digits = [0 for _ in range(max_l[N])]
    n_match = N
    for i in range(max_l[N]):
        for a in A:
            ma = num_to_match(a)
            if n_match - ma < 0:
                continue
            if max_l[n_match - ma] == max_l[n_match] - 1:
                digits[i] = a
                n_match -= ma
                break
    print(''.join(map(str, digits)))


if __name__ == '__main__':
    main()
a,b,c=map(int,input().split())
print('YES' if a=b+c or b=a+c or c=a+b else 'NO')

### FIXED CODE ###

a,b,c=map(int,input().split())
print('Yes' if a==(b+c) or b==(a+c) or c==(a+b) else 'No')
a,b = map(str,input().split())
if pow(int(a+b),0.5,1) == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

x,y = map(str,input().split())

if int(x+y)**0.5%1 == 0:
    print("Yes")
else:
    print("No")
a=s.count('R')
if a==0:
    print(a)
elif s[1]=='S':
    print(a-1)
else:
    print(a)

### FIXED CODE ###

s=input()
a=s.count('R')
if a==0:
    print(a)
elif s[1]=='S' and a==2:
    print(a-1)
else:
    print(a)
a,b = map(int,input().split())
if a*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")
from collections import Counter
n=int(input())
a=list(map(int,input().split()))

c=Counter(a)
m=c.most_common()
tmp=[]
for i in range(len(m)):
    if(m[i][1]>=2):
        tmp.append(m[i])
d=sorted(tmp,key=lambda tmp:tmp[1])

if(d[0][1]>=4):
    print(d[0][0]**2)
elif(len(d)>=2):
    print(d[0][0]*d[1][0])
else:
    print(0)

### FIXED CODE ###

from collections import Counter
n=int(input())
a=list(map(int,input().split()))
c=Counter(a)
m=c.most_common()
t=sorted(m,key=lambda m:m[0],reverse=True)
w=0
b=0
for i in range(len(t)):
    if(t[i][1]>=4):
        if(w==b==0):
            w=t[i][0]
            b=t[i][0]
        elif(w==0):
            w=t[i][0]
        elif(b==0):
            b=t[i][0]
    elif(t[i][1]>=2):
        if(w==0):
            w=t[i][0]
        elif(b==0):
            b=t[i][0]
print(w*b)
s = str(input())

for i in range(s):
  if i == "○":
    count +=
    
print(700 + count * 100)

### FIXED CODE ###

s = input()

count = 700

for i in s:
  if i == "o":
    count += 100
    
print(count)
S = int(input())
for i in range(1, 4):
  if A[i] == A[i-1]:
    print("Bad")
    exit()
print("Good")

### FIXED CODE ###

S = input()
for i in range(1, 4):
  if S[i] == S[i-1]:
    print("Bad")
    exit()
print("Good")
n = int(input())
ans = ''`
while n != 0:
    if n % (-2) == 0:
        ans = '0' + ans
    else:
        ans = '1' + ans
        n -= 1
    n /= -2
if ans == '':
    ans = '0'
print(ans)

### FIXED CODE ###

n = int(input())
ans = ''
while n != 0:
    if n % (-2) == 0:
        ans = '0' + ans
    else:
        ans = '1' + ans
        n -= 1
    n /= -2
if ans == '':
    ans = '0'
print(ans)
import math

N, M = map(int, input().split())
S = list(input())
T = list(input())

def main(N, M, S, T):
    result = N * M // math.gcd(N, M)
    cand = (result // N) * (result // M) // math.gcd((result // N), (result // M))
    for i in range(0, result // cand):
        if S[(i * cand + 3) // (result // N) - 1] != T[(i * cand + 3) // (result // M) - 1]:
            return '-1'
    return result
print(main(N, M, S, T))

### FIXED CODE ###

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

def main():
    N, M = map(int, input().split())
    S = input()
    T = input()
    result = N * M / gcd(N, M)
    cand = (result / N) * (result / M) / gcd(int((result / N)), int((result / M)))
    for i in range(0, int(result / cand)):
        if S[int((i * cand) / (result / N))] != T[int((i * cand) / (result / M))]:
            return '-1'
    return int(result)
print(main())
import numpy as np
h, w, m = map(int, input().split())
arr = np.zeros([h, w], dtype=np.int8)
for _ in range(m):
    c_h, c_w = map(int, input().split())
    arr[c_h-1, c_w-1] = 1
    
row_sum = np.sum(arr, axis=1)
col_sum = np.sum(arr, axis=0)
row_max_pos = np.argwhere(row_sum == np.max(row_sum))
col_max_pos = np.argwhere(col_sum == np.max(col_sum))
    
row_max = int(max(row_sum))
col_max = int(max(col_sum))

ans = []
for i in row_max_pos:
    for j in col_max_pos:
        if arr[i,j] == 1:
            ans.append(row_max + col_max-1)
        else
            ans.append(row_max + col_max-1)

### FIXED CODE ###

h, w, m = map(int, input().split())
h_cnt = [0 for i in range(h)]
w_cnt = [0 for i in range(w)]
bomb = set()

for i in range(m):
    _h, _w = map(int, input().split())
    h_cnt[_h-1] += 1
    w_cnt[_w-1] += 1
    bomb.add(((_h-1),(_w-1))) #爆破対象の位置を判断

h_max = max(h_cnt)
w_max = max(w_cnt)

max_h = []
max_w = []

for i in range(h):
    if h_cnt[i] == h_max:
        max_h.append(i)

for i in range(w):
    if w_cnt[i] == w_max:
        max_w.append(i)

flg = True

for i in max_h:
    for j in max_w:
        if (i,j) not in bomb:
            flg = False
            break
print(h_max+w_max-1 if flg else h_max+w_max)
k=int(input())
s=input()
print(S[:K]) if len(S) <= K else print(S[:K] + "...")

### FIXED CODE ###

K=int(input())
S=input()
print(S[:K]) if len(S) <= K else print(S[:K] + "...")
a = list(input())
i = 0
while True:
    odd = a[i]
    if odd == 'L':
        print('No')
        break
    i += 1
    if i+1 == len(a):
        print('Yes')
        break
    even = a[i]
    if even == 'R':
        print('No')
        break
    i += 1
    if i+1 == len(a):
        print('Yes')
        break

        

### FIXED CODE ###

a = list(input())
i = 0
while True:
    odd = a[i]
    if odd == 'L':
        print('No')
        break
    i += 1
    if i == len(a):
        print('Yes')
        break
    even = a[i]
    if even == 'R':
        print('No')
        break
    i += 1
    if i == len(a):
        print('Yes')
        break
x = input()
if X.isupper():
  print('A')
else:
  print('a')

### FIXED CODE ###

x = input()
if x.isupper():
  print('A')
else:
  print('a')
i = list(map(int,input().split()))

a = i[0]
b = i[1]

plus = a + b
minus = a - b
add = a * b
if a == 0 & b == 0 :
    perse = 0
else :
    perse = a/b

list = [plus, minus, add, perse]

flag = True
for l in list :
    if flag :
        box = l
        flag = False
    else :
        if l >= box :
            box = l
print(box)

### FIXED CODE ###

i = list(map(int,input().split()))

a = i[0]
b = i[1]

plus = a + b
minus = a - b
add = a * b

list = [plus, minus, add]

flag = True
for l in list :
    if flag :
        box = l
        flag = False
    else :
        if l >= box :
            box = l
print(box)
import re
pattern = re.compile('[ACGT]+')
S = input()
print(len(max(re.findall(pattern, S), default=0)))

### FIXED CODE ###

import re
pattern = re.compile('[ACGT]+')
S = input()
print(len(max(re.findall(pattern, S), key=len, default='')))