Harryxun/stf_run huggingface dataset:
#https://atcoder.jp/contests/abc131/tasks/abc131_c
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

a,b,c,d = [int(i) for i in input().split()]
C = 0
D = 0
E = 0
'''
for i in range(int(a / max(c,d,lcm(c,d))),b-a):
    print(i)
    if c * i >= a and c * i <= b and C == 0:
        C = c * i
    if d * i >= a and d * i <= b and D == 0:
        D = d * i
    if lcm(c,d) * i >= a and lcm(c,d) * i <= b and E == 0:
        E = lcm(c,d) * i
    if C != 0 and D != 0 and E != 0:
        break
'''
for i in range(int(a / lcm(c,d)),b-a):
    if lcm(c,d) * i >= a and lcm(c,d) * i <= b and E == 0:
        E = lcm(c,d) * i
        break

for i in range(int(a / c),b-a):
    if c * i >= a and c * i <= b and C == 0:
        C = c * i
        break

for i in range(int(a / d),b-a):
    if d * i >= a and d * i <= b and D == 0:
        D = d * i
        break
#print('')
#print(C,D,E)
c2 = int(b / c) - int(C / c)+1
d2 = int(b / d) - int(D / d)+1
e2 = int(b / lcm(c,d)) - int(E / lcm(c,d))+1
#print(b-a+1,c2,d2,e2)
'''
c1 = list(range(C,b+1,c))
d1 = list(range(D,b+1,d))
e1 = list(range(E,b+1,lcm(c,d)))
print(b-a+1,len(c1),len(d1),len(e1))

print(c1,d1,e1)

print(b-a+1-len(c1)-len(d1)+len(e1))
'''
print(int(b-a+1 - c2 - d2 + e2))

### FIXED CODE ###

#https://atcoder.jp/contests/abc131/tasks/abc131_c

import fractions

def gcd(x, y):
    if x < y:
        x, y = y, x
    while y > 0:
        x, y = y, x % y
    return x
'''
def lcm(a,b):
	return a*b//gcd(a,b)
'''
a,b,c,d = [int(i) for i in input().split()]
'''
C = 0
D = 0
E = 0
'''
'''
for i in range(int(a / max(c,d,lcm(c,d))),b-a):
    print(i)
    if c * i >= a and c * i <= b and C == 0:
        C = c * i
    if d * i >= a and d * i <= b and D == 0:
        D = d * i
    if lcm(c,d) * i >= a and lcm(c,d) * i <= b and E == 0:
        E = lcm(c,d) * i
    if C != 0 and D != 0 and E != 0:
        break
'''
'''
for i in range(int(a / lcm(c,d)) - 1,int(b / lcm(c,d))+2):
    if lcm(c,d) * i >= a and lcm(c,d) * i <= b and E == 0:
        E = lcm(c,d) * i
        break

for i in range(int(a / c) - 1,int(b / c)+2):
    if c * i >= a and c * i <= b and C == 0:
        C = c * i
        break

for i in range(int(a / d) - 1,int(b / d)+2):
    if d * i >= a and d * i <= b and D == 0:
        D = d * i
        break
'''
#print(lcm(c,d))
#print('')
#print(C,D,E)
'''
c2 = int(b / c) - int(C / c)+1
d2 = int(b / d) - int(D / d)+1
e2 = int(b / lcm(c,d)) - int(E / lcm(c,d))+1
'''
'''
if int(b / c) == b/c:
	print('c')
	c2 += 1
if int(b / d) == b/d:
	print('d')
	d2 += 1
if int(b / lcm(c,d)) == b/lcm(c,d):
	print('e')
	e2 += 1
'''
c2 = b // c - (a-1) // c
d2 = b // d - (a-1) // d
lcm = c * d // fractions.gcd(c,d)
e2 = b // lcm - (a-1) // lcm
'''
if a % c == 0:
	#print('c')
	c2 += 1
if a % d == 0:
	#print('d')
	d2 += 1
if a % lcm(c,d) == 0:
	#print('e')
	e2 += 1
'''
'''
if E == 0:
	e2 = 0
if C == 0:
	c2 = 0
if D == 0:
	d2 = 0
'''

#print(b-a+1,c2,d2,e2)
'''
c1 = list(range(C,b+1,c))
d1 = list(range(D,b+1,d))
e1 = list(range(E,b+1,lcm(c,d)))
print(b-a+1,len(c1),len(d1),len(e1))

print(c1,d1,e1)

print(b-a+1-len(c1)-len(d1)+len(e1))
'''
print(int(b-a+1 - c2 - d2 + e2))
import numpy as np
#int(input())
n=int(input())
ae=[]
for _ in range(n):
    ae.append(int(input()))
ae=np.array(ae)
min_ae=min(ae)
num_ae=-(-n//ae)-1
#num_ae=-(-ae//min_ae)
print(5+max(num_ae))

### FIXED CODE ###

import numpy as np
#int(input())
n=int(input())
ae=[]
for _ in range(5):
    ae.append(int(input()))
ae=np.array(ae)
min_ae=min(ae)
num_ae=-(-n//ae)-1
#num_ae=-(-ae//min_ae)
print(5+max(num_ae))
N,K = [ int(it) for it in input().split() ]
S = [ int(it) for it in input() ]

li = []

v = 1
c = 0
for it in S:
  if (v != it ):
    li.append(c)
    c=1
  else:
    c+=1
  v = it
li.append(c)
s = 0
lis = [0]*(len(li)+1)
for i in range(len(li)):
  lis[i+1]=lis[i]+li[i]
s = 0
for i in range(N):
  if (i*2>=N):
    continue
  a = min(i*2,len(li))
  b = min(i*2+2*K+1,len(li))

  ds2 = lis[b]-lis[a]
  s = max(s,ds)
print (s)


### FIXED CODE ###

N,K = [ int(it) for it in input().split() ]
S = [ int(it) for it in input() ]

li = []

v = 1
c = 0
for it in S:
  if (v != it ):
    li.append(c)
    c=1
  else:
    c+=1
  v = it
li.append(c)
s = 0
lis = [0]*(len(li)+1)
for i in range(len(li)):
  lis[i+1]=lis[i]+li[i]
s = 0
for i in range(N):
  if (i*2>=N):
    continue
  a = min(i*2,len(li))
  b = min(i*2+2*K+1,len(li))

  ds2 = lis[b]-lis[a]
  s = max(s,ds2)
print (s)
# coding: utf-8
# Your code here!
eng_li = []
removed_list = []
all_letter = 26
for i in range (97,97+all_letter):
    eng_li.append(chr(i))

string = list(raw_input().strip())
length = len(string)
if length < all_letter:
    for i in string:
        eng_li.remove(i)
    string.append(eng_li[0])
    answer = "".join(string)
else:
    for i in range(all_letter-1):
        if ord(string[-1]) < ord(string[-2]) :
            removed_list.append(string[-1])
            string.pop()
        else:
            removed_list.append(string[-1])
            string.pop()
            removed_list=filter(lambda x:x>string[-1],sorted(removed_list))
            string.pop()
            string.append(removed_list[0])
            answer ="".join(string)
            break
    else:
        answer = -1
print answer


    
        



### FIXED CODE ###

# coding: utf-8
# Your code here!
eng_li = []
removed_list = []
all_letter = 26
for i in range (97,97+all_letter):
    eng_li.append(chr(i))
 
string = list(raw_input().strip())
length = len(string)
if length < all_letter:
    for i in string:
        eng_li.remove(i)
    string.append(eng_li[0])
    answer = "".join(string)
else:
    for i in range(all_letter-1):
        if ord(string[-1]) < ord(string[-2]) :
            removed_list.append(string[-1])
            string.pop()
        else:
            removed_list.append(string[-1])
            string.pop()
            removed_list=filter(lambda x:x>string[-1],sorted(removed_list))
            string.pop()
            string.append(removed_list[0])
            answer ="".join(string)
            break
    else:
        answer = -1
print answer
import sys
sys.setrecursionlimit(1000000)
def input():
    return sys.stdin.readline()[:-1]
n = int(input()) # 素数のリスト
n_z = n # n/z
prime_e = []
p = 2 # 最初の素数
e = 1

def fermat_test(q):
    q = abs(q)
    if q == 2: return True
    elif q < 2 or q & 1 == 0:    # q & 1 == 0 偶数の場合の意。 
    # x(int) & y(int)と表記すると2進数表記にしたときに、各桁のどこかが一致する場合は1、どこも一致しない場合は0を返す。
    # 例えば10→2進数:1010と1→2進数:1を比較するとドコモ一致しないので、0が帰ってくる。
    # 2進数表記の偶数は一番下の桁が0のため、2進数表記の1は一致しないため、0が返ってくる。
        return False

while p * p <= n: # 素数pの2乗がnより大きいと1回も割れない。
    # print("current n_z: {}".format(n_z))
    if n_z % p == 0:
        z = p ** e
        while n_z % z == 0:
            n_z = n_z / z
            prime_e.append(z)
            e += 1
            z = p ** e           
    p += 1
    e = 1
    while fermat_test(p) == False:
        # print("{} is Not Prime".format(p))
        p += 1
print(len(prime_e)#, prime_e)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
from collections import defaultdict
n = I()
def primes(n):
    cnt = defaultdict(int)
    for i in range(2,int(n**0.5)+1): # range(3)だと、0,1,2が出てくる。
        while n % i == 0:
            cnt[i] += 1 # 同じ素数で何回割れるか辞書型で登録しておく
            n //= i # iで割り切った商で更新しておく
    if n > 1: # nの平方根より大きい値があった場合、追加
        cnt[n] += 1
    return cnt
prs = primes(n) #　素数の辞書
ans = 0
for key in prs.keys(): #辞書から素数を抽出して、その素数の指数値をvとして格納する。
    v = prs[key]
    for i in range(100):
        # if (i * (i+1)) // 2 <= v:　これだと何度も足し算してしまう。
        if (i * (i + 1)) // 2 > v: # 指数eを超えた一つ前が目的の計数である。
            ans += (i-1)
            break
print(ans)
#MLE注意！0や1のケースに注意

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math
    #from math import gcd

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    a = list(map(int, input().split()))
    res = 0
    l = [0]*(10**6)
    used = []
    for i in range(n):
        l[i+1-a[i]] += 1
        used.append(i+1-a[i])
    for i in range(n):
        l[used[i]] -= 1
        b = i+1+a[i]
        res += l[b]
    print(res)



if __name__ == '__main__':
    main()

### FIXED CODE ###

#MLE注意！0や1のケースに注意

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math
    #from math import gcd

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    a = list(map(int, input().split()))
    res = 0
    l = [0]*(10**6)
    used = []
    for i in range(n):
        if 0<=i+1-a[i]<n:
            l[i+1-a[i]] += 1
            used.append(i+1-a[i])
    cnt = 0
    for i in range(n):
        if 0<=i+1-a[i]<n:
            l[used[cnt]] -= 1
            cnt += 1
        if 0<=i+1+a[i]<10**6:
            b = i+1+a[i]
            res += l[b]
    print(res)



if __name__ == '__main__':
    main()
A=int(input())
B=int(input())

a = A + B
b = A - B
C = A * B
number = [a,b,c]
print(max(number))

### FIXED CODE ###

A,B = map(int,input().split())
print(max(A+B,A-B,A*B))
a

### FIXED CODE ###

a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
d = [a[0],b[0],c[0]]
e = [a[1],b[1],c[1]]
f = [a[2],b[2],c[2]]
g = [a[0],b[1],c[2]]
h = [a[2],b[1],c[0]]

n = int(input())

bs = []
for _ in range(n):
    bs.append(int(input()))

for l in [a,b,c,d,e,f,g,h]:
    if (l[0] in bs) and (l[1] in bs) and (l[2] in bs):
        print("Yes")
        break
else:
        print("No")
a,n=map(int,input())
b=[]
for i in range(n):
  b.append(int(input())
flag="F"
which flag=="F":
  k=a
  fflag="T"
  which k>=1 and fflag=="T":
    l=int(k%10)
    for i in range(n):
      if a[i]==l:
        fflag="F"
    break
  if fflag=="T":
    flag="T"
  else:
    a+=1
print(a)

### FIXED CODE ###

a,n=map(int,input().split())
b=input()
c=[]
for i in range(n):
  c.append(int(b[2*i]))
flag="F"
while flag=="F":
  k=a
  fflag="T"
  while k>=1:
    l=int(k%10)
    for i in range(n):
      if c[i]==l:
        fflag="F"
        break
    k=int(k/10)
    if fflag=="F":
      break
  if fflag=="T":
    flag="T"
  else:
    a+=1
print(a)
l=list(map(int,input().split())).sort()
print(l[0]+l[1])


### FIXED CODE ###

l=list(map(int,input().split()))
l.sort()
print(l[0]+l[1])
n = int(input())
p=3.142
print(2*n*p)


### FIXED CODE ###

n,m=map(int, input().split())
A = list(map(int, input().split()))
if n-sum(A)<0:
    print(-1)
    exit()

print(n-sum(A))
import math, functools

N, X = map(int, input().split())
x = [int(x) for x in input().split()]
A = []

if N > 1:
  for n in range(N-1):
    a = abs(x[n] - x[n+1])
    A.append(a)

  D = functools.reduce(math.gcd, A)
else:
  D = x[0] - X
print(D)

### FIXED CODE ###

from fractions import gcd
from functools import reduce

n,x = map(int, input().split())
X = [int(i) for i in input().split()]
X = [abs(x-j) for j in X]
ans = reduce(gcd, X)
print(ans)
n,k=map(int,input().split())
a=list(map(int,input().split()))
d={j:0 for j in range(32)}
for ai in a:
  for j in range(32):
    if (ai>>j) & 1:
      d[j]+=1
ans=0
l=len(bin(k))-3
import sys
sys.setrecursionlimit(10**7)

def dp(m,t): # 一番左の桁（l桁目）から考える。一番右の桁は0桁目。t:kより真に小さいかどうか
  if m<0:return 0
  ret=0
  if t==1: # 以降は好きに選んでいいので、最適な数字を選ぶ。一意。
    for i in range(m+1):
      tmp=max(0,n-2*d[i])
      ret+=pow(2,i)*tmp
  else:
    if (k>>m)&1: #kのm桁目が1なら1か0を選べる
      tmp1=dp(m-1,0)+(n-2*d[m])*pow(2,m)
      tmp0=dp(m-1,1)
      ret+=max(tmp1,tmp0)
    else:
      ret+=dp(m-1,0)
  return ret

print(sum(a)+dp(l,0))

### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
d={j:0 for j in range(41)}
for ai in a:
  for j in range(41):
    if (ai>>j) & 1:
      d[j]+=1
ans=0
l=len(bin(k))-3
import sys
sys.setrecursionlimit(10**7)

def dp(m,t): # 一番左の桁（l桁目）から考える。一番右の桁は0桁目。t:kより真に小さいかどうか
  if m<0:return 0
  ret=0
  if t==1: # 以降は好きに選んでいいので、最適な数字を選ぶ。一意。
    for i in range(m+1):
      tmp=max(0,n-2*d[i])
      ret+=pow(2,i)*tmp
  else:
    if (k>>m)&1: #kのm桁目が1なら1か0を選べる
      # 1にするとき
      tmp1=dp(m-1,0)+(n-2*d[m])*pow(2,m)
      # 0にするとき
      tmp0=dp(m-1,1)                    
      ret+=max(tmp1,tmp0)
    else:
      ret+=dp(m-1,0)
  return ret

print(sum(a)+dp(l,0))
def frog1(h):
    dp = [0]*3
    for i in range(len(h)):
        dp[i%3] = min([dp[(i-j)%3] + abs(h[i]-h[i-j]) for j in range(1,3)])
    return dp[len(h)%3]

n = int(raw_input())
h = map(int, raw_input().split()
        
print(frog1(h))

### FIXED CODE ###

def frog1(h):
    dp = [float('inf')]*3
    dp[0] = 0
    for i in range(1,len(h)):
        dp[i%3] = min([dp[(i-j)%3] + abs(h[i]-h[i-j]) for j in range(1,3)])
    return dp[(len(h)-1)%3]
    
n = input()
vals = list(map(int, input().split()))

print(frog1(vals))
import itertools
n = int(input())
a = list(map(int, input().split()))
m = 0
for i in itertools.combinations(a,2):
    j = [h for h in itertools.combinations(range(max(i[0],i[1])), min(i[0],i[1]))]
    if m < len(j):
        m = len(j)
        l = i
print(max(l[0],l[1]),min(l[0],l[1]))

### FIXED CODE ###

import itertools
n = int(input())
a = list(map(int, input().split()))
m = max(a)
t = (10**9)+1
for i in a:
    if abs(i-(m//2)) < t and i != m:
        t = abs(i-(m//2))
        s = i
print(m,s)
N = int(input())
def prime_dict(n):
    a = {}
    if n%2 == 0:
        a[2] = 1
        n//=2
        exp2 = 2
    while n%(2**exp2) == 0:
        a[2] += 1
        n //= 2**exp2
        exp2 += 1
    while n%2 == 0:
        n //= 2
    f = 3
    expn = 1
    while f**expn <= n:
        while f**expn <= n:
            if n%(f**expn) == 0:
                if f not in a:
                    a[f] = 1
                else:
                    a[f] += 1
                n //= f**expn
            expn += 1
        while n%f == 0:
            n //= f
        f += 2
        expn = 1
    if n!= 1:
        a[n] = 1
    return a

primes = prime_dict(N)
ans = sum(primes.values())
print(ans)



### FIXED CODE ###

from collections import Counter
N = int(input())
def prime_factorize(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
ans = 0
primes = prime_factorize(N)
pc = Counter(primes)
for v in pc.values():
    now = 1
    while now*(now+1)//2 <= v:
        now += 1
    ans += now-1
print(ans)
N = int(input())
D = list(map(int,input().split()))
A = []
for i in range(N):
  for j in range(1,N):
    A.append(N[i]*(j-i)
print(sum(A))

### FIXED CODE ###

N = int(input())
D = list(map(int,input().split()))
A = []
for i in range(N-1):
  for j in range(i+1,N):
    A.append(D[i]*D[j])
print(sum(A))
import sys
n = int(sys.stdin.readline())
s, t = map(str, sys.stdin.readline())
text = ''
for i in s:
  for k in t:
    text += i
    text += k
print(text)

### FIXED CODE ###

import sys
n = int(sys.stdin.readline())
s, t = map(str, sys.stdin.readline().split())
i = 0
text = ''
while i < n:
  text += s[i] + t[i]
  i += 1
print(text)
i = j = 0
n = ''
m = ''


line = input()

while line[i] != ' ':
    n = n + line[i]
    i += 1
    
while i < len(line):
    m = m + line[i]
    i += 1
    
n = int(n)
m = int(m)

print(n*m 2*n+2*m)

### FIXED CODE ###

i = j = 0
n = ''
m = ''


line = input()

while line[i] != ' ':
    n = n + line[i]
    i += 1
    
while i < len(line):
    m = m + line[i]
    i += 1
    
n = int(n)
m = int(m)

print(n*m,end=' ')
print(2*n+2*m)
N = int(input())
X = list(map(int, input().split()))
print(min(lambda p: sum((x-p)**2 for x in X) for i in range(max(X)+1)))


### FIXED CODE ###

def cal_cost(X, P):
    cost = 0
    for x in X:
        cost += (x - P) ** 2
    return cost


def main(N, X):
    return min(cal_cost(X, p) for p in range(max(X) + 1))


if __name__ == "__main__":
    N = int(input())
    X = list(map(int, input().split()))
    ans = main(N, X)
    print(ans)
n,k = map(int,input())
h = list(map(int,input().split()))
cnt=0
for i in range(n):
	if k<=h[i]:
		cnt+=1
print(cnt)

### FIXED CODE ###

import math
N = int(input())
a=N//2
b=N-a

print(b/N)
n = int(input())
A = list(map(int,input().split()))
for i in range(n):
  if A[i]<0 and A[i+1]<0:
    A[i] = -A[i]
    A[i+1] = -A[i]
  elif A[i]<0:
    if A[i]-A[i+1]<0:
      A[i] = -A[i]
      A[i+1] = -A[i]
print(sum(A))
    

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
INF = 10**9

dp0 = [0]
dp1 = [-INF-1]

for i, x in enumerate(A):
  dp0.append( max(dp0[i] + x, dp1[i] - x) )
  dp1.append( max(dp0[i] - x, dp1[i] + x) )

print(dp0[-1])
S=input()
if S[1]==S[2]==S[3] or S[2]==S[3]==S[4]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S=input()
if S[0]==S[1]==S[2] or S[1]==S[2]==S[3]:
  print("Yes")
else:
  print("No")
abc=input().split()
a,b,c=int(abc[0]),int(abc[1]),int(abc[2])

print(max(0,c-(a-b))

### FIXED CODE ###


abc=input().split()
a,b,c=int(abc[0]),int(abc[1]),int(abc[2])
 
print(max(0,c-(a-b)))
N = int(input())
A = list(map(int, input().split()))

tar = 1
for i in range(A):
    tar *=  i

if tar > 10 ** 18:
    print(-1)
else:
    print(tar)


### FIXED CODE ###


import sys
N = int(input())
A = list(map(int, input().split()))
A.sort()
tar = 1
for i in A:
    tar *= i
    if tar > 10 ** 18:
        print('-1')
        sys.exit()

print(tar)
import collections
N=int(input())
l=[input() for i in range(N)]
c=collections.Counter(l)
l2=[]

M=c.most_common()[0][1]
for i in range(N):
    if c.most_common()[i][1]==M:
        l2.append(c.most_common()[i][0])
    else:
        break
l2.sort()
for j in range(len(l2)):
    print(l2[j])

### FIXED CODE ###

N=int(input())
dic={}
for i in range(N):
    s=input()
    if s in dic:
        dic[s]+=1
    else:
        dic[s]=0
m=max(dic[i] for i in dic)
ans=[]
for j in dic:
    if dic[j]==m:
        ans.append(j)
ans.sort()
for k in range(len(ans)):
    print(ans[k])
ABC=map(int,input().split())
ABC.sort()
ans=0
ans+=(ABC[2]-ABC[0])//2
if (ABC[2]-ABC[0])%2==1:
  ans+=(ABC[2]-ABC[0])//2
  ABC[0]=ABC[2]-1
  ans+=(ABC[2]-ABC[1])//2
  if (ABC[2]-ABC[1])%2 == 1:
    ans+=1
  else:
    ans+=2  
else:
  ans+=(ABC[2]-ABC[1])//2
  if (ABC[2]-ABC[1])%2 == 1:
    ans+=2
  else:
    ans+=1
print(ans)

### FIXED CODE ###

ABC=list(map(int,input().split()))
ABC.sort()
ans=0
ans+=(ABC[2]-ABC[0])//2
if (ABC[2]-ABC[0])%2==1:
  ans+=(ABC[2]-ABC[1])//2
  if (ABC[2]-ABC[1])%2 == 1:
    ans+=1
  else:
    ans+=2  
else:
  ans+=(ABC[2]-ABC[1])//2
  if (ABC[2]-ABC[1])%2 == 1:
    ans+=2

print(ans)
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
n = len(s)
ans = 0
lst = ['A','T','G','C']
for i in range(n):
    if s[i] not in lst:
        continue
    for j in range(i+1,n):
        if s[j] not in lst:
            break
    ans = max(ans,j-i)
print(ans)

### FIXED CODE ###

#!/usr/bin/env python3

a = input()

l = ["A","T","G","C"]
count  = 0
max = 0
t = 0
for i in range(len(a)):
    for j in range(i,len(a)):
        if(a[j] not in l):
            count = 0
            break;
        else:
            count += 1
            if(max < count):
                max = count
    count = 0
print(max)
A,B = map(int,input().split())
while i<=10000:
  if (int((i*0.08)==A)) and (int((i*0.1)==B)):
    print(i)
    exit()
  i+=1
print(-1)

### FIXED CODE ###

A,B = map(int,input().split())
i=1
while i<=10000:
  if (int(i * 0.08) == A) & (int(i * 0.10) == B):
    print(i)
    exit()
  i+=1
print(-1)
x = int(intput())
if x == 7 or x == 5 or x == 3:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

x = int(input())
if x == 7 or x == 5 or x == 3:
    print('YES')
else:
    print('NO')
import collections


if __name__ == '__main__':
    n = int(input())
    a = [int(i) for i in input().split()]
    q = int(input())
    key = [i for i in range(10**5)]
    val = [0]*(10**5)
    dict = dict(zip(key,val))
    dict.update(collections.Counter(a))
    ans = sum(a)

    for i in range(q):
        b, c = map(int, input().split())
        ans= ans - b*dict[b] + c*dict[b]
        count = dict[b]
        dict[b]=0
        dict[c]+=count
        print(ans)





### FIXED CODE ###

import collections


if __name__ == '__main__':
    n = int(input())
    a = [int(i) for i in input().split()]
    q = int(input())
    key = [i for i in range(10**5+1)]
    val = [0]*(10**5+1)
    dict = dict(zip(key,val))
    dict.update(collections.Counter(a))
    ans = sum(a)

    for i in range(q):
        b, c = map(int, input().split())
        ans= ans - b*dict[b] + c*dict[b]
        count = dict[b]
        dict[b]=0
        dict[c]+=count
        print(ans)
a, b = map(int, input().split())
print(a-n*2)

### FIXED CODE ###

a, b = map(int, input().split())
c = max(a-b*2, 0)
print(c)
a,b = map(int,input().split())
s = list(input())
ans = True
for i in range(a+b+2):
    if i == a and s[i] != '-':
        ans = 'No'
    if not s[i].isdigit() and i != a:
        ans ='No'
        break
    if s[i].isdigit() and i != a:
        if 0>int(s[i]) or int(s[i]) > 9:
            ans ='No'
            
print (ans)

### FIXED CODE ###

a,b = map(int,input().split())
s = list(input())
ans = 'Yes'
if len(s) != a+b+1:
    ans = 'No'
else:
    for i in range(a+b+1):
        if i == a and s[i] != '-':
            ans = 'No'
            break
        if (not s[i].isdigit()) and i != a:
            ans ='No'
            break
print (ans)
n,x=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for i in range(1,n):
  temp=max(0,a[i]+a[i-1]-x):
  ans=ans+temp
  a[i]=a[i]-temp
print(ans)

### FIXED CODE ###

N,x=map(int,input().split())
A=list(map(int,input().split()))+[0]
ans=0
for i in range(N):
  eated=max(0,A[i]+A[i-1]-x)
  ans+=eated
  A[i]-=eated
print(ans)
N,x = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
for i in range(N-1):
    if a[i] > x:
        ans +=  a[i]-x
        a[i] = x
    if a[i] + a[i+1] > x:
        ans += a[i]+a[i+1]-x
        a[i+i] -= a[i]+a[i+1]-x
print(ans)
        

### FIXED CODE ###

N,x = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
for i in range(N-1):
    if a[i] > x:
        ans +=  a[i]-x
        a[i] = x
    if a[i] + a[i+1] > x:
        ans += a[i]+a[i+1]-x
        a[i+1] -= a[i]+a[i+1]-x
print(ans)
A = int(input())
B = int(input())
count = 1

while A < B:
    A += A
    count += 1
    if A > B:
        break

print(count)


### FIXED CODE ###

A = input().split()
count = 1
a = int(A[0])
b = int(A[1])
c = a

if b == 1:
    print(0)
else:
    while a < b:
        a += c - 1
        count += 1
        if a > b:
            break
    print(count)
import math
a,b,x = map(int,input().split())

if x >= (a**2)*b*1/2:
    y = (-1)*b + 2*x/(a**2)
    if y==0:
        print(45.0)
        exit()
    d = math.atan(a / (b-y))
else:
    y = 2*x/(a*b)
    d = math.atan(y/b)
print(90 - math.degrees(d))

### FIXED CODE ###

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

if x >= a*a*b/2:
    y = (-1)*b + 2*x/(a**2)
    if b != y:
        d = math.atan(a / (b-y))
    else:
        print(0)
        exit()
else:
    y = 2*x/(a*b)
    d = math.atan(y/b)
print(90 - math.degrees(d))