peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
#!/usr/bin/env pypy
 
import sys
import string
def get_int(): return int(sys.stdin.readline().strip())
def get_ints(): return map(int, sys.stdin.readline().strip().split()) 
def get_list(): return list(map(int, sys.stdin.readline().strip().split())) 
def get_string(): return sys.stdin.readline().strip()
def out(data): return sys.stdout.write(str(data))
def out_list(arr): return sys.stdout.write(' '.join(str(e) for e in arr))

MAX = 10**9
MOD = 10**9 + 7

n = get_int()
alp = " "+string.ascii_lowercase
ans = ''

while n:
  ans = alp[(n-1)%26+1] + ans
  n = (n-1) // 26
print(ans)
# Judge status: Wrong Answer
N,L = map(int,input().split())
a = [0]*N
for i in range(N):
  a[i] = L+i
all_apple_pie = sum(a)
apple_pie = [0]*N
def_apple_pie = [0]*N
for i in range(N):
  t = a[i]
  a[i] = 0
  apple_pie[i] = sum(a)
  def_apple_pie[i] = abs(all_apple_pie-apple_pie[i])
  a[i] = t
print(min(def_apple_pie))
# Judge status: Accepted
import numpy as np
n = int(input())
V = list(map(float, input().split()))

V = np.array(sorted(V))
for i in range(1, n):
  V[:i+1] = V[:i+1] /2
print(np.sum(V))
# Judge status: Accepted
a=input()
b=input()

if a[0] == b[2] and a[2] == b[0] and a[1] == b[1]:
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
x = int(input())
for i in range(2000):
  for j in range(-100,1000):
    if i**5 - j**5 == x and x%(i-j) == 0:
      print(i,j)
      break
# Judge status: Accepted
n = int(input())

num = 0

t_b = [[0 for i in range(10)] for j in range(10)]
for i in range(1,n+1):
    si = str(i)
    t_b[int(si[0])][int(si[-1])] += 1

for i in range(10):
    for j in range(10):
        num += t_b[i][j]*t_b[j][i]

print(num)
# Judge status: Accepted
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = int(sys.stdin.readline().rstrip())
    lines = ["".join(sorted(line.rstrip())) for line in sys.stdin.readlines()]

    ret = 0
    sortedlines = {}
    for n in range(N):
        item = lines[n]
        if item in sortedlines:
            sortedlines[item] += 1
            ret += sortedlines[item] - 1
        else:
            sortedlines[item] = 1

    print(ret)


if __name__ == '__main__':
    main()
# Judge status: Accepted
x = int(input())
a = x // 11
x -= a * 11
if x == 0:
    print(2 * a)
elif x <= 6:
    print(2 * a + 1)
else:
    print(2 * a + 2)
# Judge status: Accepted
N = int(input())
C = [0]*100
for i in range(1,N+1):
  s = str(i)
  C[10*int(s[0])+int(s[-1])] += 1
print(sum([C[10*i+j]*C[10*j+i] for i in range(10) for j in range(10)]))
# Judge status: Accepted
X=input()
N=len(X)
stack=[]
ans=0

for i in range(N):
  if X[i]=="S":
    stack.append(X[i])
  else:
    if len(stack)>0:
      stack.pop()
    else:
      ans += 1
ans += len(stack)

print(ans)
# Judge status: Wrong Answer
N,X,Y=map(int,input().split())
print (N)
print (2*N+X-Y-4)
lists=[1,1,1,1]
t=0
for k in range(3,N):
  t=N+X-Y-k+1
  if k<Y-X:
    t=t+(N-1-k)
  if k<X-1:
    t=t-1
  if k<N-Y:
    t=t-1
  print (t)
  t=0
# Judge status: Wrong Answer
import numpy as np
#N,K = map(int,input().split())
N = int(input())
a,b,c = map(int,input().split())
ab,bb,cb = a,b,c
ma = max(a,b,c)
ans = ma
for i in range(1,N):
  a,b,c = map(int,input().split())
  if ma == ab:
    a = 0
  elif ma == bb:
    b = 0
  elif ma == cb:
    c = 0
  ma =max(a,b,c)
  ab,bb,cb = a,b,c
  ans += ma  
print(ans)
# Judge status: Wrong Answer
n, a, b, c, d = map(int, input().split())
s = str(input())
if '##' in s[a:c] or '##' in s[b:d]:
    print('No')
    exit()
if c > d and '...' not in s[b:d + 2]:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
S = input()
flag = False
for i in range(len(S)):
  for j in range(i, len(S)):
    if S[:i] + S[j:] == "keyence":
      flag = True
if flag:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
N = int(input())
s = input()
t = input()

for i in range(N):
  for j in range(N - i):
    if s[i + j] != t[j]:
      break
  else:
    print(i + N)
    exit()

print(N * 2)
# Judge status: Accepted
N, L = map(int, input().split())
S = sorted([input() for i in range(N)])
print(''.join(S))
# Judge status: Wrong Answer
sList = sorted(list(set(list(input()))))
chI = ord('a')
for i in sList:
  if chI == ord(i):
    chI += 1
  else:
    print(chI)
    exit(0)

print("None")
# Judge status: Accepted
from collections import deque
n = int(input())
a = list(map(int, input().split()))
d = deque()
for i in range(n):
    if n%2 == 0:
        if i%2 == 0:
            d.append(a[i])
        else:
            d.appendleft(a[i])
    else:
        if i%2 == 0:
            d.appendleft(a[i])
        else:
            d.append(a[i])
print(" ".join(list(map(str, d))))
# Judge status: Accepted
def main():
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    p.sort()
    ans = 0
    for i in range(k):
        ans += p[i]
    print(ans)

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
h,w=map(int,input().split())
if h%2 == 0 or w%2 == 0:
  print(h*w/2)
else:
  print(int(h*w/2)+1)
# Judge status: Accepted
import sys
from bisect import bisect_left,bisect_right,insort
#input = sys.stdin.readline

def main():
    s=list(input())
    a,b=0,0
    x,y=0,0
    for i in range(len(s)):
        if i%2==0:
            a+=int(s[i])
            x+=1
        else:
            b+=int(s[i])
            y+=1
    print(min(x-a+b,y-b+a))
           

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N, x = map(int, input().split())
A = list(map(int, input().split()))

if len(A) % 2 == 0:
    A = A + [0]

ans = 0
for i in range(1, N, 2):
    v = max(0, max(A[i - 1] + A[i] - x, A[i] + A[i + 1] - x))
    A[i] -= v
    ans += v
# print('A', A)
print(ans)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0

for i in range(a):
  for j in range(b):
    for k in range(c):
      if x == 500*(i+1)+100*(j+1)+50*(k+1) :
        ans +=1
        
print(ans)
# Judge status: Accepted
sd=input()
t=input()
n=len(sd)
m=len(t)
if n<m:
    print("UNRESTORABLE")
    exit(0)
for i in range(n-m,-1,-1):
    t_kana=sd[i:i+m]
    for j in range(m+1):
        if j==m :
            print((sd[:i]+t+sd[i+len(t):]).replace("?","a"))
            exit(0)
        if t_kana[j]=="?":
            continue
        elif t_kana[j]!=t[j]:
            break
print("UNRESTORABLE")
# Judge status: Accepted
s = input()
t = input()
if t[:len(s)] == s:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
X,N = input().split()
X,N = int(X),int(N)

P = input().split()
P = [int(c) for c in P]

i = X
j = X

if len(P) == 0:
    print(X)    
elif X  not in P:
    print(X)
else:
    while i < 101:
        i += 1
        if i not in P:
            break
    while j > 0:
        j -= 1
        if j not in P:
            break
    
    if i - X >= X - j:
        print(j)
    else:
        print(i)
# Judge status: Wrong Answer
n, *a_l = map(int, open(0).read().split())
multi_4 = sum([1 for a in a_l if a%4 == 0])
multi_2 = sum([1 for a in a_l if a%2 == 0]) - multi_4
print( 'Yes' if ((multi_4 * 2 + 1 ) + multi_2) >= n else 'No')
# Judge status: Wrong Answer
N = int(input())
ans = 10**14
for i in range(1, N//2):
    a = sum(map(int, str(i)))
    b = sum(map(int, str(N-i)))
    ans = min(a+b, ans)
print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
ans=[-1]*n
if n==1 and m==0:
    print(0)
    exit()
for i in range(m):
    s,c=map(int,input().split())
    if ans[s-1]!=-1 and ans[s-1]!=c:
        print(-1)
        exit()
    ans[s-1]=c
if ans[0]==-1:
    ans[0]=1
elif ans[0]==0 and n>1:
    print(-1)
    exit()
x=0
for i in range(n):
    x*=10
    if ans[i]!=-1:
        x+=ans[i]

print(x if len(str(x))==n else -1)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
k = int(input())
print(a+b+c+max(a,b,c)*(2**(k-1)))
# Judge status: Wrong Answer
n = int(input())
ans = "No"
j = 0
for i in range(n):
  d,dd = map(str,input().split())
  if(d==dd):
    if(j>0):
      j += 1
    if(j==3):
      ans = "Yes"
  else:
    j=0
print(ans)
# Judge status: Accepted
N,D = map(int,input().split())
i = 0
k = 0
while N != i :
    x,y = map(int,input().split()) 
    if (x**2+y**2) <= D**2 :
        k += 1
    i +=1
print(k)
# Judge status: Accepted
a, b, c, d = map(int, input().split())
ans = max(a*c , a*d, b*c, b*d)
print(ans)
# Judge status: Accepted
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if K < N: sum = K*X + (N-K)*Y
else: sum = N*X

print(sum)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if 1<= (a and b) <=9:
    print(a*b)
else:
    print("-1")
# Judge status: Accepted
O = input()
E = input()
if len(O) > len(E):
  print(''.join([o+e for o, e in zip(O,E)] + [O[-1]]))
else:
  print(''.join([o+e for o, e in zip(O,E)]))
# Judge status: Wrong Answer
n, m = map(int, input().split())

if n == 1 or m == 1:
    ans = max(n, m) - 2
else:
    ans = (n - 2) * (m - 2)
    print(ans)

print(ans)
# Judge status: Wrong Answer
import numpy as np
N=int(input())
A = list(map(int, input().split()))

A_diff = np.diff(A)
print(A_diff)

a=[0]*N
cnt=1
j=0
for i in range(len(A_diff)):
  if A_diff[i] == 0:
    cnt+=1
    continue
  else:
    a[j] += cnt
    cnt=1
    j+=1
a[j] += cnt

for ans in a:
  print(ans)
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
s = list(input())
for i in s:
  if i == "a" and a != 0:
    a -= 1
    print("Yes")
  elif i == "b" and b != 0:
    b -=1
    print("Yes")
  else:
    print("No")
# Judge status: Wrong Answer
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(n)]
ab.sort()
ans = 0
cnt = 0
for i in ab:
    a, b = i[0], i[1]
    if cnt + b >= m:
        print(ans + (m - cnt) * a)
    else:
        ans += a * b
        cnt += b
# Judge status: Accepted
a,b=map(int, input().split())
s=a+b
if s<24:
  print(s)
else:
  print(s-24)
# Judge status: Wrong Answer
n=int(input())	
s=0		
a=list(map(int,input().split()))
for i in range(n-1):
  for j in range(i+1,n):
    s+=a[j]*a[i]
print(s)
# Judge status: Wrong Answer
A = list(map(int, input().split()))
a = sorted(A)
k = str(A[-1])+str(A[1])
print(int(k)+A[0])
# Judge status: Accepted
n,m=map(int,input().split())
print(n*m-2*(n+m)+4 if n!=1 and m!=1 else max(n*m-2,1))
# Judge status: Wrong Answer
from math import gcd
from functools import reduce

N = int(input())
A = tuple(map(int, input().split(' ')))

base = reduce(gcd, A)
rest = 1

ans1 = A[0]
for a in A[1:]:
    b = gcd(ans1, a)
    if rest > 0 and b == base:
        rest -= 1
    else:
        ans1 = b

ans2 = A[1]
for a in A[1:]:
    b = gcd(ans2, a)
    if rest > 0 and b == base:
        rest -= 1
    else:
        ans2 = b

print(max(ans1, ans2))
# Judge status: Accepted
const = 1000000007
n, m = [int(_) for _ in input().split()]
dp = [0]* (n+2)

for _ in range(m):
    dp[int(input())] = -1

dp[0] = 1
dp[n+1] = -1

for i in range(0, n):
    if dp[i] != -1:
        if dp[i+1] != -1:
            dp[i+1] += dp[i]
        if dp[i+2] != -1:
            dp[i+2] += dp[i]

print(dp[n]%const)
# Judge status: Accepted
N = int(input())
sub_yes = 0
max_yes = 0
for i in range(N):
    d1,d2 = map(int,input().split())
    if d1 == d2:
        sub_yes += 1
        if sub_yes > max_yes:
            max_yes = sub_yes
    else:
        if sub_yes > max_yes:
            max_yes = sub_yes
        sub_yes = 0
if max_yes >= 3:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
cnt=0
for i in range(n):
    if (i+1)!=a[i]:
        cnt+=1
if cnt <=2:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
N,M=map(int,input().split())
L=[]
X=[]
for i in range(N):
	L.append(input())
for i in range(M):
	X.append(input())
for i in range(N-M+1):
	for j in range(N-M+1):
		if L[i][j]==X[0][0]:
			ans=0
			for x in range(M):
				for y in range(M):
					if L[i+x][j+y]==X[x][y]:
						ans+=1
			if ans==(M**2):
				print("Yes")
				exit()
print("No")
# Judge status: Accepted
N = int(input())

def ht(n):
    str_n = str(n)
    head = int(str_n[0])
    tail = int(str_n[-1])
    return (head, tail)

htmap = [[0] * 10 for i in range(10)]

for i in range(1, N+1):
    h,t = ht(i)
    htmap[h][t] += 1

ans = 0
for i in range(1, N+1):
    h,t = ht(i)
    ans += htmap[t][h]

print(ans)
# Judge status: Accepted
import math
a,b = [int(i) for i in input().split()]
mina = math.ceil(a*100/8)
if (a+1)*100/8%1==0:
    maxa = (a+1)*100/8-1
else:
    maxa = math.floor((a+1)*100/8)

minb = math.ceil(b*100/10)
if (b+1)*100/10%1==0:
    maxb = (b+1)*100/10-1
else:
    maxb = math.floor((b+1)*100/10)

#print(mina,maxa,minb,maxb)

if minb<=mina and mina<=maxb:
    print(int(mina))
elif mina<=minb and minb<=maxa:
    print(int(minb))
else:
    print("-1")
# Judge status: Wrong Answer
s=str(input())
t=str(input())

flag=False

m=0

for i in range(len(s)-len(t)+1):
  cnt=0
  for j in range(len(t)):
    #print(s[i+j],t[j])
    if s[i+j]==t[j]:
      cnt+=1
      flag=True
    else:
      if flag==True:
        if m==0 or m<cnt:
          m=cnt
        cnt=0
        flag=False

print(len(t)-m)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def keyence20_a():
    H, W, N = map(int, readlines())
    lg = max(H, W)
    ans = (N + lg - 1) // lg
    print(ans)

keyence20_a()
# Judge status: Wrong Answer
N, M = map(int, input().split())
ans = int((2*N + M)//4)
print(ans)
# Judge status: Accepted
S = input()
ANSlist = []

for i in range(len(S)):
    if S[i] == '0':
        ANSlist.append('0')
    elif S[i] == '1':
        ANSlist.append('1')
    elif S[i] == 'B':
        if len(ANSlist) >=1:
            del ANSlist[-1]

ANS = ''.join(ANSlist)

print(ANS)
# Judge status: Wrong Answer
def main():
    ind = int(input())
    t = list(map(int, input().split()))
    ans = []
    for i in range(ind):
        if len(ans) + 1 == t[i]:
            ans.append(t[i])
    count = 0 if len(ans) == 0 else ind - len(ans)
    print(count)



if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,k=mp()
h=sorted(lmp())
if n<=k:
    print(0)
else:   
    print(sum(h[:n-k]))
# Judge status: Wrong Answer
N,M = map(int,input().split())    

print(N + (M-2*N)//4)
# Judge status: Accepted
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    H = int(input())

    bin_k = 0
    tmp = H
    while True:
        bin_k += 1
        tmp = tmp // 2
        if tmp == 0:
            break

    ans = 0
    for i in range(bin_k):
        ans += 2 ** i

    print(ans)


if __name__ == '__main__':
    solve()
# Judge status: Wrong Answer
n,k,q = map(int,input().split())
A=[int(input()) for _ in range(q)]

p=[0]*n

for a in A:
    p[a-1]+=1
    
for P in p:
    if q-P < k:
        print("yes")
    else:
        print("no")
# Judge status: Wrong Answer
N = int(input())
Hn = [float("inf")] + list(map(int, input().split()))

cur = N
ans = 0
while cur > 1:
    a = abs(Hn[cur] - Hn[cur - 1])
    b = abs(Hn[cur] - Hn[cur - 2])
    if a < b:
        ans += a
        cur -= 1
    else:
        ans += b
        cur -= 2

print(ans)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
mod = 10**9+7

def main():
    N = int(input())
    A = list(map(int, input().split()))
    for i in range(N):
        if A[i] == 0:
            print(0)
            return
    
    ans = 1
    for i in range(N):
        ans *= A[i]
        if ans > 10**18:
            print(-1)
            return
    print(ans)
    

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
r = int(input())
print(r*r*3.14)
# Judge status: Wrong Answer
def average(x,y):
    return (x+y)/2
N=int(input())
v=list(map(int,input().split()))
v.sort(reverse=True)
for j in range(N-1):
    min=1001
    for i in range(N-1-j):
        if v[i]-v[i+1]<min:
            min=v[i]-v[i+1]
            mini=i
    v[mini]=average(v[mini],v[mini+1])
    v.pop(mini+1)
    v.sort(reverse=True)
print(v[mini])
# Judge status: Accepted
n=int(input())
B=list(map(int,input().split()))
ans = 0

ans += B[0]
for i in range(n-2):
  ans += min(B[i],B[i+1])
ans += B[n-2]

print(ans)
# Judge status: Wrong Answer
n = int(input())
D = list(map(int,input().split()))

D.sort()
print(D[n//2] -D[n//2-1]+1)
# Judge status: Wrong Answer
K,S=open(0);K=int(K.split()[1]);u=[S[0]]


def count_unhappy():
    for c in S:
        if c != u[-1]:
            u.append(c)
    return max(len(u) - 2 * K, 1)


print(len(S) - count_unhappy())
# Judge status: Accepted

def main():
    c = input()
    print(chr(ord(c)+1))

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a,b = map(int,input().split(" "))
print(int(round((a+b)/2,0)))
# Judge status: Accepted
A, B, X = map(int, input().split())

if A <= X <= A+B:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
n = int(input())
color = list(input())
left = 0
right = len(color) - 1
ans = 0
while left<right:
    if(color[left]=='W' and color[right]=='R'):
        ans += 1
        left += 1
        right -=1
    if color[left] == 'R':
        left+=1
    if color[right] == 'W':
        right -=1
print(ans)
# Judge status: Accepted
t = list(map(int,input().split()))
a = list(map(int,input().split()))
s = sum(a)
count = 0

for i in range(t[0]):
    if a[i] >= s/(4 * t[1]):
        count += 1

if count >= t[1]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
a = [0]*(N+1)
for x in range(101):
    for y in range(101):
        for z in range(101):
            d = x*x+y*y+z*z+x*y+y*z+x*z
            if d <= N:
                a[d] += 1
for i in range(1, N+1):
    print(a[i])
# Judge status: Accepted
import fractions

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

print(a*b//c)
# Judge status: Wrong Answer
n = int(input())
lst = []
for i in range(n):
  lst.append(int(input()))

not10nums = [i for i in lst if i%10!=0]
subnum=0
if len(not10nums)>0:
  subnum=min(not10nums)
# Judge status: Accepted
n, k = map(int, input().split())
r, s, p = map(int, input().split())
T = list(input())
ans = 0
commands = ['']*n
for i, t in enumerate(T):
  if t == 'r':
    command = 'p'
    point = p
  elif t == 's':
    command = 'r'
    point = r
  elif t == 'p':
    command = 's'
    point = s
  if (i - k >= 0) and (commands[i-k] == command):
    command = ''
    point = 0
  ans += point
  commands[i] = command
  
print(ans)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
print((max([a, b, c]) * 3 - (a + b + c)) // 2)
# Judge status: Accepted
wrong_date = input()
date = '2018' + wrong_date[4:]
print(date)
# Judge status: Wrong Answer
from collections import deque


s = input()
q = int(input())
op = [input().split() for _ in range(q)]

ans = deque()
ans.append(s)

for i in op:
    if i[0] == "1":
        ans.reverse()
    if i[0] == "2":
        if i[1] == "1":
            ans.appendleft(i[2])
        elif i[1] == "2":
            ans.append(i[2])

print("".join(ans))
# Judge status: Accepted
n, k = map(int, input().split())
attacks = []
mxa = 0

for i in range(n):
    a, b = map(int, input().split())
    attacks.append([a, b])
    mxa = max(mxa, a)
attacks = sorted(attacks, key=lambda x: -x[1])

ans = 0
idx = 0
while k > 0:
    if idx < n and attacks[idx][1] > mxa:
        k -= attacks[idx][1]
        idx+=1
    else:
        ans += (k)//mxa
        if k%mxa != 0:
            ans += 1
        break
    ans+=1
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
n1=max(a)
n2=-n1
nc=n1/2
for m in a:
  if abs(m-nc)<abs(n2-nc) and m!=n1:
    n2=m
print (n1,n2)
# Judge status: Wrong Answer
from sys import exit

n = int(input())

for a in range(1, 10):
    for b in range(1, 10):
        if a * b == n:
            print("Yes")
            exit()
        else:
            print("No")
# Judge status: Wrong Answer
a,b,t=map(int,input().split())
print(b*t//a)
# Judge status: Wrong Answer

n = int(input())

a_list = list(map(int, input().split()))
buka_list = []

one_a = ''.join([str(n) for n in a_list])

one_a = str(one_a)

print(one_a)

for i in range(1, n + 1):

    # print('iは')
    # print(i)

    print(one_a.count(str(i)))

    # buka_list.append(one_a.count('i'))
# Judge status: Accepted
s = input()

if len(s) % 2 == 1:
    s = s[:-1]
else:
    s = s[:-2]

while s[:len(s) // 2] != s[len(s) // 2:]:
    s = s[:-2]

print(len(s))
# Judge status: Accepted
s = input()

answer, count = 0, 0
for c in s:
    if c in "ACGT":
        count += 1
    else:
        answer = max(answer, count)
        count = 0
answer = max(answer, count)

print(answer)
# Judge status: Accepted
N=int(input())
a=0
b=[0]
for i in range(N):
  tmp=int(input())
  if tmp%10!=0:
    b.append(tmp)
  a+=tmp
b.sort()
if a%10!=0:
  print(a)
else:
  if len(b)!=1:
    print(a-b[1])
  else:
    print(0)
# Judge status: Accepted
import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0

n,k = map(int,input().split())
n = n%k
if abs(n-k) >= n:
    print(n)
else:
    print(abs(n-k))
# Judge status: Accepted
n, q = map(int, input().split())
s = input().rstrip()

ac = [0] * n

count = 0
for i in range(n-1):
    if s[i] == 'A' and s[i+1] == 'C':
        count += 1
    ac[i] = count

for i in range(q):
    l, r = map(int, input().split())

    if l == 1:
        print(ac[r-2])
    else:
        print(ac[r-2] - ac[l-2])
# Judge status: Accepted
a,b,c,k = map(int,input().split())
if a+b>=k:
    print(min(k,a))
else:
    print(a-(k-a-b))
# Judge status: Accepted
N,K = map(int,input().split())
A = [0] + list(map(int,input().split()))

now = 1

while K:
  if K & 1:
    now = A[now]
  A = [A[A[i]] for i in range(len(A))]
  K >>= 1
  
print(now)
# Judge status: Accepted
a, b = map(int, input().split())
if (a + b) % 2 == 0:
  print((a + b) // 2)
else:
  print("IMPOSSIBLE")
# Judge status: Accepted
S = input()
T = input()

for i in range(len(S)):
    S = S[1:] + S[0]
    if S == T:
        print('Yes')
        exit()
print('No')
# Judge status: Wrong Answer
x,n=map(int,input().split())
if n==0:
  print(x)
  exit()
p=list(map(int,input().split()))

c=[]
ans=100000
b=[]
for i in range(-1000,1001):
  c.append(i)
for i in range(n):
  c.remove(p[i])
  
for i in range(len(c)):
  sa=abs(x-c[i])
  if ans>sa and sa!=0:
    ans=sa
    
for i in range(len(c)):
  if ans==abs(x-c[i]):
    b.append(c[i])

if ans==10000:
  print(x)
else:
  b.sort()
  print(b[0])
# Judge status: Accepted
A, B, C = map(int, input().split())
if A == B and B ==C:
  print('No')
elif A != B and B != C and C != A:
  print('No')
else:
  print('Yes')
# Judge status: Accepted
from collections import Counter
s = input()
d = Counter(s)
n = len(s)
if n%3==0:
  if all(v==n//3 for v in d.values()):
    print('YES')
  else:
    print('NO')
else:
  if all(v==n//3 or v==n//3+1 for v in d.values()):
    print('YES')
  else:
    print('NO')
# Judge status: Accepted
from collections import Counter

n = int(input())
li = []
for i in range(n):
    s = list(input())
    s.sort()
    li.append("".join(s))

a = Counter(li)
ans = 0
for i in dict(a).values():
    ans += i*(i-1)//2
print(ans)
# Judge status: Wrong Answer
h,n=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
if a[0]<h:
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
s = input()
res = [0] * (len(s)+1)

for i in range(len(s)):
  if s[i] == "<":
    res[i +1] = res[i] +1

for i in range(len(s)-1,-1,-1):
  if s[i] == ">":
    res[i] = max(res[i], res[i+1]+1)

print(sum(res))
# Judge status: Accepted
K,S = map(int,input().split())
ans = 0
for x in range(K+1):
    for y in range(K+1):
        if 0 <= S-x-y <= K:
            ans += 1
print(ans)
# Judge status: Accepted
N = int(input())
n = str(N)

if n[-1] == '3':
    print('bon')
elif n[-1] == '0' or n[-1] == '1' or n[-1] == '6' or n[-1] == '8':
    print('pon')
else:
    print('hon')