peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n='0'+input()

X=[]
for i in range(len(n)):
    X.append(int(n[i]))
cnt=0
i=len(n)-1
while i>=0:
    if X[i]>5:
        cnt+=10-X[i]
        X[i-1]+=1
        
    elif X[i]==5:
        cnt+=5
        if X[i-1]>=5:
            X[i-1]+=1
    else:
        cnt+=X[i]
    i-=1
print(cnt)
# Judge status: Accepted
def main():
    n = int(input())
    A = list(map(int, input().split()))
    ans = 1
    if 0 in A:
        print(0)
        return
    for a in A:
        ans *= a
        if ans > 10 ** 18:
            print(-1)
            break
    else:
        print(ans)
if __name__ == '__main__':
    main()
# Judge status: Accepted

import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read
inp = sys.stdin.buffer.readline
def inpS(): return inp().rstrip().decode()
readlines = sys.stdin.buffer.readlines
MOD = 10**9+7
INF = 1<<60

from bisect import bisect_right, bisect_left
def resolve():
    N = int(input())
    A = [int(input()) for _ in range(N)][::-1]

    dp = [INF]*(N+1)
    for a in A:
        ind = bisect_right(dp, a)
        dp[ind] = a

    ans = bisect_left(dp, INF)
    print(ans)

if __name__ == "__main__":
    resolve()
# Judge status: Wrong Answer
import sys

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))


n = ri()
li = rl()
cnt_li = [0]*10**5
ans = 0
for i in range(10**5):
    cnt_li[i] = li.count(i)
for i in range(10**5-1):
    ans = max(ans, cnt_li[max(0, i-1)] + cnt_li[i] + cnt_li[i+1])
print(ans)
# Judge status: Wrong Answer
a = int(input())
n = list(map(int,input().split()))
cnt  = 1
ans = 0
for i in n:
    cnt = cnt +1
    if cnt % 2 == 1 and i % 2 == 1 :
        ans = ans + 1 
print (ans)
# Judge status: Accepted
num = int(input())
 
A = []
B = []
for i in range(num):
    x,y = map(int,input().split())
    A.append(x)
    B.append(y)
 
val = 0
for i in range(num-1,-1,-1):
    if (A[i]+val)%B[i] == 0:
        pass
    elif A[i] + val > B[i]:
        val += B[i]-((A[i]+val)%B[i])
    else:
        val += B[i]-(A[i]+val)  
print(val)
# Judge status: Wrong Answer
N = input()
for i in range(1,9+1):
    if N.count(str(i)*3):
        print('Yes')
    else:
        exit()
print('No')
# Judge status: Accepted
X,Y,Z = input().split()
print(Z,X,Y)
# Judge status: Wrong Answer
n,m,x,y = map(int,input().split())
x = sorted(map(int,input().split()))
y = sorted(map(int,input().split()))
print("No War" if x[-1] < y[0] else "War")
# Judge status: Accepted
#!/usr/bin/env python

def main():
    x = int(input())
    ret = 10 - x//200
    print(ret)

if __name__ == '__main__':
    main()
# Judge status: Accepted
A, B, C, X = [int(input()) for _ in range(4)]
print(sum(a*500+b*100+c*50==X for a in range(A+1) for b in range(B+1) for c in range(C+1)))
# Judge status: Accepted
import sys
import math

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
   
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N=int(input())
cnt=0
li=[]

for _ in range(N):
	li.append(int(input()))
	
so=sorted(li)
ct=1

for i in range(N-1):
	if so[i]==so[i+1]:
		ct+=1
	else:
		cnt+=ct%2
		ct=1
		
cnt+=ct%2



if N==1:
	print(1)
else:	
	print(cnt)
# Judge status: Accepted
A, B, C, D = map(int, input().split())

while True:
     C -= B
     if C<=0:
         print("Yes")
         break
     A -= D
     if A<=0:
         print("No")
         break
# Judge status: Accepted
X,Y=map(int,input().split())
print(X+int(Y/2))
# Judge status: Accepted
s=input()
a=s.count('0')
b=len(s)-a
print(min(a,b)*2)
# Judge status: Accepted
n = input()
Nr = list(map(int,list(reversed(n))))
Nr.append(0)

ans = 0 
for i in range(len(Nr)):
    if Nr[i] > 5:
        Nr[i+1] += 1
        ans += (10 - Nr[i])
    elif Nr[i]==5:
        if Nr[i+1]>=5:
            Nr[i+1] += 1
            ans += (10 - Nr[i])
        else:
            ans += Nr[i]
    else:
        ans += Nr[i]

print(ans)
# Judge status: Accepted
Q,H,S,D=map(int,input().split())
N=int(input())
usage=[]
slist=[4*Q,2*H,S]
slist.sort()
s=slist[0]  #これが1Lの値段に
dlist=[8*Q,4*H,2*s,D]
dlist.sort()
d=dlist[0]  #これが2Lの値段に

if N%2==0:
    print(d*(N//2))
else:
    print(d*(N//2)+s)
# Judge status: Accepted
import bisect

N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
B.sort()
C.sort()
a = [0] * N
for i in range(N):
	a[i] = N - bisect.bisect_right(C, B[i])
i = N - 1
while 0 < i:
	a[i - 1] += a[i]
	i -= 1
ans = 0
for i in A:
	b = bisect.bisect_right(B, i)
	if b == N:
		continue
	ans += a[b]
print(ans)
# Judge status: Accepted
a,b = map(str,input().split())
ab = a*int(b)
ba = b*int(a)

if ab < ba:
    print(int(ab))
else:
    print(int(ba))
# Judge status: Wrong Answer
import re

s = input().replace('?', 'Q')
t = input()

check_chr = t[0]+'Q'*(len(t)-1)

m_obj = re.search(check_chr, s)

if m_obj:
  ans = s.replace(check_chr, t)
  ans = ans.replace('Q', 'a')
  print(ans)
else:
  print('UNRESTORABLE')
# Judge status: Wrong Answer
n,d=map(int,input().split())
print(n//(2*d+1)+1)
# Judge status: Accepted
n = input()
gift = set()

for num in range(int(n)):
    gift.add(input())

print(len(gift))
# Judge status: Accepted
X = int(input())
lsx = [1]*(2*10**5)

for i in range(2,2*10**5):
    if lsx[i] == 1:
        for j in range(i,2*10**5//i):
            lsx[j*i] = 0

for i in range(X,2*10**5):
    if lsx[i] == 1:
        print(i)
        break
# Judge status: Accepted
n = int(input())
l = [i - 1 for i in map(int, input().split())]
cnt = 0
for j, k in enumerate(l):
    if j != k:
        cnt += 1
if cnt == 0 or cnt == 2:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
w,a,b = map(int,input().split())
x = max(a,b)
y = min(a,b)
if (x-y) > w:
  print((x-y)-w)
else:
  print(0)
# Judge status: Wrong Answer
x,y = map(int, input().split())
if x == y: print(-1)
else:
    print(min(x,y)*2)
# Judge status: Accepted
from collections import deque

N = int(input())
A = map(int, input().split())
B = deque()
flag = 0
for a in A:
  if flag:
    B.appendleft(a)
  else:
    B.append(a)
  flag = 1 - flag

B = list(B)
if flag:
  print(*B[::-1])
else:
  print(*B)
# Judge status: Accepted
n, k = map(int, input().split())
alst = list(map(int, input().split()))

for _ in range(k):
    tmp = [0 for _ in range(n + 1)]
    for i, num in enumerate(alst):
        min_ind = max(i - num, 0)
        max_ind = min(i + num + 1, n)
        tmp[min_ind] += 1
        tmp[max_ind] -= 1
    next_num = 0
    for i, num in enumerate(tmp[:-1]):
        next_num += num
        alst[i] = next_num
    if tmp[0] == n and tmp[-1] == -n:
        break
print(*alst)
# Judge status: Accepted
X, Y = map(int, input().split())
ans = 0
while X <= Y:
    ans += 1
    X *= 2
print(ans)
# Judge status: Wrong Answer
import numpy as np
import math

N, K = map(int, input().split())
A = np.array([1] + list(map(lambda x: math.log(int(x)), input().split())))

PA = np.cumsum(A)

B = []
for i in range(K, N + 1):
    b = PA[i] - PA[i - K]
    B.append(float(b))

ans = [['No', 'Yes'][B[i - 1] < B[i]] for i in range(1, len(B))]

print('\n'.join(ans))
# Judge status: Wrong Answer
N, M = map(int, input().split())
ans = ((N - 2) * (M - 2))

if N==1 and M > 1:
    ans = M - 2
elif N==1 and M < 1:
    ans = N - 2
elif N==1 and M==1:
    ans = 1

print(ans)
# Judge status: Wrong Answer
# 解説動画視聴

s = input()

a = [0]*(len(s)+1)

for i in range(len(s)):
    if s[i] == '<':
        a[i+1] = max(a[i+1],a[i]+1)
for i in range(len(s)-1,0,-1):
    if s[i] == '>':
        a[i] = max(a[i],a[i+1]+1)

print(sum(a))
# Judge status: Wrong Answer
t=1;p=0;m=2019;c=[0]*m;r=0
for x in (input()+'0')[::-1]:p=(int(x)*t+p)%m;r+=c[p];c[p]+=1;t=t*10%m
print(r%m)
# Judge status: Wrong Answer
X, Y = input().split()
  
if X > Y:
  print("safe")
else:
  print("unsafe")
# Judge status: Wrong Answer
S = input()
K = int(input())

ans = ""
for s in S:
    if 123-ord(s) <= K:
        ans += "a"
        K -= 123-ord(s)
    else:
        ans += s
if K > 0:
    ans = ans[:-1] + chr((ord(ans[-1])-97+K)%26+97)
print(ans)
# Judge status: Accepted
import sys
h,w = map(int, input().split())
 
if h == 1 or w == 1:
  print(1)
  sys.exit(0)
  
if (h*w) % 2 == 0:
  print((h*w)//2)
else:
  print((h*w)//2 + 1)
# Judge status: Wrong Answer
import math

A,B,H,M = map(int,input().split())


A_kaku = 30*(H)+0.5*(M)
B_kaku = 6*M
kaku = abs(A_kaku - B_kaku)
kaku = min(kaku,180-kaku)
kaku = math.radians(kaku)
X2 = A*A + B*B - 2*A*B*math.cos(kaku)
X2 = math.sqrt(X2)
print(X2)
# Judge status: Accepted
from sys import stdin
H,A = [int(x) for x in stdin.readline().rstrip().split()]
ans = 0
while True:
    H -= A
    ans += 1
    if H <= 0:
        break
print(ans)
# Judge status: Wrong Answer
a=list(input())
b=sorted(a)
if b[0]==b[1] and b[2]==b[3]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import math
n = int(input())
st = [list(map(int, input().split())) for i in range(n-1)]
for j in range(n-1):
    t = st[j][1]+st[j][0]
    for i in range(j+1,n-1):
        if t<st[i][1]:
            t = st[i][1]
        elif (t-st[i][1])%st[i][2]!=0:
            t += st[i][2]-(t-st[i][1])%st[i][2]
        t += st[i][0]
    print(t)
print(0)
# Judge status: Accepted
A,V = map(int, input().split())
B,W = map(int, input().split())
T = int(input())
 
if A < B: 
    Ap = A + V*T
    Bp = B + W*T

    if Ap >= Bp:
        print('YES')
    else:
        print('NO')    
else:
    Ap = A + (-V*T)
    Bp = B + (-W*T)

    if Ap <= Bp:
        print('YES')
    else:
        print('NO')
# Judge status: Accepted
# solution

data = int(input())
n,m = map(int, input().split())
k = map(int, input().split())
j = [abs(m-(n-i*0.006)) for i in k]
print(j.index(min(j)) + 1)
# Judge status: Accepted
n,k=map(int, input().split())
prob = 0
#サイコロの確率(1/n) 

for i in range(1,n+1):
    if i < k: #サイコロを振った時点で勝っているか？
        a = 1
        while i * (2**a) < k:
            a += 1
        prob += (1/n) * ((1/2) ** a)
    else:
        prob += (1/n)
print(prob)
# Judge status: Accepted
a, b, c, d = map(int, input().split())

max_t = max(a, c)
min_t = min(b, d)

print(max(min_t-max_t, 0))
# Judge status: Wrong Answer
S = input()
t = '2018' + S[4:]
# Judge status: Accepted
#!/usr/bin/env python3
def main():
    _ = int(input())
    A = [int(x) for x in input().split()]
    mod = 10 ** 9 + 7

    lst = [sum(A)]
    for j in A:
        lst.append(lst[-1] - j)
    ans = 0
    for index, i in enumerate(A):
        ans += i * lst[index + 1] % mod
    print(ans % mod)


if __name__ == '__main__':
    main()
# Judge status: Accepted
def main():
    a, b = map(int, input().split())
    diff = b - a
    high_a = sum(list(range(1, diff)))
    print(high_a - a)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
# 20200612_yorukatsu_e.py
import collections
N = int(input())
A = list(map(int,input().split()))
C = collections.Counter(A)
ans = 0
for i,v in C.items():
    # print(i,v)
    if i!=v:
        if i<v:
            ans += v-1
        else:
            ans += v
print(ans)
# Judge status: Accepted
N=int(input())
root=int((N**0.5)//1)
a=N
b=N
for i in range(root, 0, -1):
    if N%i==0:
        a=i
        b=N//i
        break
print(a-1+b-1)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())

if b - a == c - b:
    print('YES')
else:
    print('No')
# Judge status: Wrong Answer
'''ABC172 C'''
import numpy as np
n,m,k = map(int,input().split())
a = np.array([int(i) for i in input().split()], dtype='int64')
b = np.array([int(i) for i in input().split()], dtype='int64')

a_c = np.zeros(n+1,dtype='int64')
a_c[1:] = np.cumsum(a)

b_c = np.zeros(m+1,dtype='int64')
b_c[1:] = np.cumsum(b)

a_c = a_c[a_c <= k]
b_c = b_c[b_c <= k]
ans = 0
for i,ai in enumerate(a_c):
    n = np.searchsorted(b_c, k - ai, side = 'right')
    ans = max(i + n, ans)
print(ans)
# Judge status: Accepted
n = int(input())
p = list(map(int,input().split()))
count = 0

for i in range(n):
  if i + 1 != p[i]:
    count += 1
    if count >= 3:
      print("NO")
      exit()
print("YES")
# Judge status: Accepted
n = int(input())

if n <= 999:
    print('ABC')
else:
    print('ABD')
# Judge status: Accepted
# https://atcoder.jp/contests/arc069/tasks/arc069_a

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

if n * 2 >= m:
    ans = m // 2
else:
    ans = n + (m - n * 2) // 4
print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
s=''
ans=1
for i in range(n-1):
  if a[i]<a[i+1]:
    s+='x'
  elif a[i]>a[i+1]:
    s+='y'
for i in range(len(s)-1):
  if s[i]!=s[i+1]:
    ans+=1
print(ans)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())

if A - B + C >= 0:
    print(C - A + B)
else:
    print(0)
# Judge status: Accepted
n = int(input())
s = input()
t = input()
same = []
for i in range(n):
  if t[0:i+1] == s[len(s)-1-i:len(s)]:
    same.append(t[0:i+1])
if len(same) == 0:
  m = 0
else:
  m = len(same[len(same)-1])
print(len(s)+len(t)- m)
# Judge status: Wrong Answer
N,D = map(int,input().split())
X=[]
ans=0

def cheak_root(n):
    i=0
    while i<n:
        i+=1
        if i*i==n: return i
    return False

for i in range(N):
    X.append(list(map(int,input().split())))

for i in range(N):
    for j in range(i+1,N):
        sums=0
        for d in range(D):
            diff=X[i][d]-X[j][d]
            sums=diff*diff
        if cheak_root(sums):ans+=1
print(ans)
# Judge status: Wrong Answer
n = int(input())
s = list(input())
count = 0
ans = []
for i in s:
    if i == 'I':
        count += 1
    elif i == 'D':
        count -= 1
    ans.append(count)
print(max(ans))
# Judge status: Wrong Answer
a=input()
b=['Sunny',' Cloudy', 'Rainy']
for i in range(2):
  if i==3:
    print('Sunny')
    break
  if b[i]==a:
    print(b[i+1])
# Judge status: Accepted
n=int(input())

s=list(input())

black = [0]*n

white = [0]*n

for i in range(n):
    if s[i] == '.':
        white[i] = white[i-1]+1
        black[i] = black[i-1]
    else:
        white[i] = white[i-1]
        black[i] = black[i-1]+1
        
ans = 100000000

for i in range(n-1):
    if s[i] != s[i+1]:
        ans = min(ans,black[i]+(white[-1]-white[i+1]))
        
ans = min(ans,max(black),max(white))
print(ans)
# Judge status: Accepted
N = int(input())
h = list(map(int,input().split()))

INF = float('inf')
dp = [INF] * N
dp[0] = 0
for i in range(1,N):
  dp[i] = min(dp[i], dp[i-1]+abs(h[i]-h[i-1]))
  if i > 1:
    dp[i] = min(dp[i], dp[i-2]+abs(h[i]-h[i-2]))
print(dp[-1])
# Judge status: Accepted
a,b = map(int,input().split())

def pf(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

aa = set(pf(a))
bb = set(pf(b))
ans = aa & bb

print(len(ans) + 1)
# Judge status: Accepted
n = int(input())
mod = 10**9+7
dp = [[0]*4 for i in range(n+1)]
dp[0][0] = 1
for i in range(n):
    dp[i+1][3] = (dp[i][3]*10 + dp[i][1] + dp[i][2]) % mod
    dp[i+1][2] = (dp[i][2]*9 + dp[i][0]) % mod
    dp[i+1][1] = (dp[i][1]*9 + dp[i][0]) % mod
    dp[i+1][0] = (dp[i][0]*8) % mod

print(dp[n][3])
# Judge status: Accepted
n, x = map(int, input().split())
l = list(map(int, input().split()))

d = 0
count = 1
for v in l:
    dv = d + v
    # print(dv)
    
    if dv > x:
        break
    
    count += 1
    d += v

print(count)
# Judge status: Wrong Answer
n=int(input())
for i in range(n):
  if i**2 > n:
    print((i-1)**2)
    break
# Judge status: Wrong Answer
arr=raw_input()
ans="No"
for i in range(len(arr)):
  if arr[i]==9:
    ans = "Yes"
print ans
# Judge status: Accepted
s = list(input())

for i in s:
    if s.count(i) > 1:
        print('no')
        break
else:
    print('yes')
# Judge status: Accepted
n=int(input())
p_list=[int(i) for i in input().split()]

np_list=sorted(p_list)

count=0
for i in range(n):
    if p_list[i]!=np_list[i]:
        count+=1

if count==2 or count==0:
    ans="YES"
else:
    ans="NO"

print(ans)
# Judge status: Wrong Answer

L,R,d = map(int,input().split())
if d == 1:
    print(R - L + 1)
else:
    print(R//d - L//d)
# Judge status: Accepted
n = int(input())

ans = [0 for _ in range(10005)]

for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            m = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if m < 10005:
                ans[m] += 1

for i in range(n):
    i += 1
    print(ans[i])
# Judge status: Accepted
a, b, c = map(int, input().split())

if a - b >= c:
    print(0)
else:
    print(c - (a - b))
# Judge status: Accepted
a = list(input())
b = list(input())

count = 0
change = 0

for i in range(len(a)):
    if a[count] == b[count]:
        count += 1
    else:
        change += 1
        count += 1
    
print(change)
# Judge status: Wrong Answer
s = input()
for i in range(len(s)):
    if s.count(s[i]) != 1:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
ans=[0]*N
for i in range(N-1):
    ans[A[i]-1]+=1
for i in range(N):
    print(ans[i])
# Judge status: Accepted
n = int(input())
for i in range(1,50001):
    if int(i*1.08) == n:
        print(i)
        exit()
print(":(")
# Judge status: Accepted
n = input()
n = list(n)

n = map(int,n)

if sum(n) % 9 == 0:print("Yes")
else: print("No")
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
X = a[0]
for i in range(1, N):
    X ^= a[i]
for ai in a:
    print(ai ^ X, end=' ')
print('')
# Judge status: Wrong Answer
N,X = map(int,input().split())
W = list(map(int,input().split())) + [X]
W = sorted(W)
dist = 10**18
if len(W) == 2:
  print(W[1]-W[0])
  exit()
for i in range(1,N):
  dist = min(dist, W[i]-W[i-1])
for j in range(1,N):
  while (W[i]-W[i-1])%dist != 0:
    dist -= 1
print(dist)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

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

if k <= a:
    use1 = a
    print(use1)
elif k <= a+b:
    use1 = a
    print(use1)
else:
    use_1 = k-c
    print(a-use_1)
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=[1]*(n+1)
b=[0]*(n+1)
b[1]=1
for _ in range(m):
  x,y=map(int,input().split())
  a[x]-=1
  a[y]+=1
  if b[x]:b[y]=1
ans=0
for i,j in zip(a,b):
  ans+=(i!=0)*j
print(ans)
# Judge status: Wrong Answer
x, y = map(int, input().split())

turu = (4*x-y)//2
kame = x-turu

if (turu < 0):
    print("No")
    exit()

if ((y-turu*2) // 4 == kame):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N, D = map(int, input().split())
X = []
for i in range(N):
  X.append(list(map(int, input().split())))
  
cnt = 0

for j in range (N-1):
  for k in range(j+1, N):
    t = 0
    for l in range(D):
      t += (X[j][l]-X[k][l])**2
      
    if (t**1/2)%1 ==0:
      cnt += 1
      
print(cnt)
# Judge status: Accepted

import sys
from fractions import gcd
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

INF = 10**18
N, M, *A = map(int, read().split())

lcm = 1
for a in A:
    a //= 2
    lcm *= a // gcd(lcm, a)
    
    if lcm > M:
        print(0); sys.exit()
for a in A:
    if lcm % a == 0:
        print(0); sys.exit()

print((M // lcm +1) // 2)
# Judge status: Accepted
N=int(input())
p=list(map(int,input().split()))
k=0
for i in range(N):
  if p[i]!=i+1:
    k+=1
if k>2:
  print('NO')
else:
  print('YES')
# Judge status: Accepted
N,A,B=map(int,input().split())

if N==1:
    print(1*(A==B))
else:
    if A>B:
        print(0)
    else:
        print((N-2)*(B-A)+1)
# Judge status: Accepted
a,b,c=(int(x) for x in input().split())
if a==b==5 and c==7:
    print('YES')
elif b==c==5 and a==7:
    print('YES')
elif c==a==5 and b==7:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
S = input()
ACGT = 0
ans = 0

for x in S:
    if x == 'A' or x == 'C' or x =='G' or x == 'T':
        ACGT += 1
    else :
        ACGT = 0
    ans = max(ans, ACGT)

print(ans)
# Judge status: Accepted
n = input()
a = int(n[0]+n[1])
b = int(n[2]+n[3])

if 1 <= a <= 12 and 1 <= b <=12:
  print("AMBIGUOUS")
elif 1 <= b <= 12:
  print("YYMM")
elif 1 <= a <= 12 :
  print("MMYY")
else:
  print("NA")
# Judge status: Accepted
N=int(input())
X=[list(map(int,input().split())) for i in range(N)]

from math import factorial as fac

S=0
for i in range(N):
    for j in range(N):
        S+=((X[i][0]-X[j][0])**2+(X[i][1]-X[j][1])**2)**(1/2)

total=fac(N)//fac(2)//fac(N-2)
print(((N-1)/(total))*S/2)
# Judge status: Wrong Answer
info = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
num = -1
for i in range(info[2]):
    temp = [int(i) for i in input().split()]
    price = a[temp[0]-1]+b[temp[1]-1]-temp[2]
    if (num == -1 or num > price):
        num = price
if min(a)+min(b) < price:
    price = min(a)+min(b)
print(price)
# Judge status: Accepted
N = int(input())
S = [input() for _ in range(N)]
print("AC x", S.count("AC"))
print("WA x" ,S.count("WA"))
print("TLE x", S.count("TLE"))
print("RE x", S.count("RE"))
# Judge status: Accepted
import sys
input = sys.stdin.readline
N, P = map(int, input().split())
a = list(map(int, input().split()))
odd = 0
even = 0
for i in range(N):
  if a[i] % 2: odd += 1
  else: even += 1
if P:
  print(int((pow(2, odd - 1) * pow(2, even) * (odd > 0))))
else:
  print(max(1, pow(2, odd - 1)) * pow(2, even))
# Judge status: Wrong Answer
n = int(input())

ans = ((n-1)*n)/2
    
print(int(ans))
# Judge status: Accepted
w,a,b=map(int,input().split())
if a<b:
  print(max(0,b-a-w))
else:
  print(max(0,a-b-w))
# Judge status: Wrong Answer
#coding:utf-8

import queue

def main():
    n, a, b = map(int, input().split())
    p = n // (a + b)
    print(p * a + n - p * (a + b))
    
if __name__ == '__main__':
    main()
# Judge status: Accepted
x = int(input())
print((x-1)//11*2+int((x-1)%11>=6)+1)
# Judge status: Accepted

n=int(input())  #数値入力 「N」だけの入力のとき
print(str(n).count('1'))
# Judge status: Accepted
S = input()
if S[0] == "A":
    S_1 = S[1:]
    if S[2:-1].count("C") == 1:
        S_1 = S_1.replace("C", "", 1)
        if S_1.islower():
            print("AC")
            exit()
print("WA")
# Judge status: Wrong Answer
a,b,c = map(int, input().split())
if (b > a and b < c) or (b < a and b > c):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
c = 0
while True:
  if all(x % 2 == 0 for x in a):
    a = [x / 2 for x in a]
    c += 1
  else:
    break
print(c)
# Judge status: Accepted
X=int(input())
li=[x**p for x in range(1,32) for p in range(2,35) if x**p<=X]
print(max(li))
# Judge status: Accepted
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
res = 0
for i in range(n):
  c = 0
  for j in range(n):
    if j < i:
      c += a[j]
    elif j == i:
      c += a[j]
      c += b[j]
    else:
      c += b[j]
  res = max(res,c)
print(res)
# Judge status: Accepted
s = input()
l = len(s)
ans = ''
for i in range(l):
    ans += 'x'
print(ans)
# Judge status: Accepted
a,b,c=map(int,open(0).read().split())
e=(a-b)|(b-c)
print(bool(e|(a|b|c)%2)*(e^~-e).bit_length()-1)
# Judge status: Accepted
N = int(input())

p = 1

for i in range(N):
    i += 1
    p *= i
    p %= 10**9 + 7

print(p)
# Judge status: Wrong Answer
A=list(input())
B=list(input())
L=[]
for a,b in zip(A,B):
    L.append(a)
    L.append(b)
print("".join(L))
# Judge status: Accepted
from sys import stdin, stdout
from time import perf_counter

import sys
sys.setrecursionlimit(10**9)
mod = 10**9+7

# import sys
# sys.stdout = open("e:/cp/output.txt","w")
# sys.stdin = open("e:/cp/input.txt","r")
l=sorted(map(int,input().split()))
print("YES" if l == [5,5,7] else "NO")
# Judge status: Accepted
from itertools import permutations

n = int(input())
x, y = [0]*n, [0]*n
for i in range(n):
  x[i], y[i] = map(int, input().split())

def dist(a, b):
  dx = x[a] - x[b]
  dy = y[a] - y[b]
  return (dx**2 + dy**2)**0.5

ans = 0
np = [x for x in range(n)]
p = list(permutations(np))
for a in p:
  memo = 0
  for i in range(n-1):
    memo += dist(a[i],a[i+1])
  ans += memo
print(ans / len(p))