peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))

p_s = sorted(p)

b = True
cnt = 0

for p1, p2 in zip(p, p_s):
    if p1 != p2:
        cnt += 1
    
    if cnt >= 3:
        b=False
        break

if b:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


x = I()
if x <= 6:
    ans = 1
elif x <= 11:
    ans = 2
else:
    ans = (x // 11) * 2
    if x % 11 == 0:
        pass
    elif x % 11 <= 6:
        ans += 1
    elif x % 11 <= 10:
        ans += 2

    print(ans)
# Judge status: Accepted
A,B = map(int, input().split())
if A > 0:
  print("Positive")
elif B<0:
  if((B-A)%2 == 0):
    print("Negative")
  else:
    print("Positive")
else:
  print("Zero")
# Judge status: Wrong Answer
S = input()
leng = len(S)
ans = 1
for i in range(leng-1, 0, -1):
    if S[:(i // 2)] == S[i // 2:i]:
        ans = i
print(ans)
# Judge status: Accepted
A=int(input())
B=int(input())
if(A==1):
  if(B==2):
    print(3)
  else:
    print(2)
elif(A==2):
  if(B==1):
    print(3)
  else:
    print(1)
else:
  if(B==1):
    print(2)
  else:
    print(1)
# Judge status: Accepted
import fractions
from functools import reduce

n = int(input())
t = [int(input()) for _ in range(n)]

ans = reduce(lambda x, y: x * y // fractions.gcd(x, y), t)
print(ans)
# Judge status: Accepted
def main():
    n = list(map(int, input()))
    if sum(n)%9 == 0:
        print('Yes')
    else:
        print('No')
        
        
if __name__ == '__main__':
    main()
# Judge status: Accepted
n,k = map(int,input().split())
p = map(int,input().split())
p = sorted(p)
total = 0
for i in range(k):
  total += p[i]
print(total)
# Judge status: Accepted
n,k=map(int,input().split())
s = input()
 
s = list(s)
s[k - 1] = s[k-1].lower()
s = "".join(s)
print(s)
# Judge status: Wrong Answer
n = int(input())
ans = (n // 10) ** 2 + 8
if str(n % 10) >= str(n)[0]:
  ans += 1
ans += 10 ** (len(str(n)) - 2) * min(n % 10, int(str(n)[0])) * 2
print(ans)
# Judge status: Wrong Answer
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions
import functools
import copy
import heapq
import decimal

sys.setrecursionlimit(10000001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===
def main():
    x = ni()

    base = x // 11 * 2
    mod = x % 11
    if mod == 0:
        hoge = 0
    elif mod > 5:
        base += 2
    else:
        base += 1

    print(base)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
if n == 0:
    print(0)
    exit()
i = 0
ans = []
while abs(n) > 0:
    ans.append(n%2)
    #n = (n - n % (2 * (-1)**i)) // 2
    n = (n - (n % 2)) // -2
    i += 1
print(''.join(map(str, ans[::-1])))
# Judge status: Wrong Answer
sets = set(map(int, input().split()))
print('Yes' if sets == set([5, 7, 5]) else 'no')
# Judge status: Wrong Answer
import numpy as np

N, K = [int(x) for x in input().split()]
A = np.array([int(x) for x in input().split()])

L = np.max(A)

ans = L
low = 1
high = L
while 1:
    print(str(low) + ' ' + str(high))
    if low == high:
        ans = low
        break
    mid = (low + high) // 2
    if np.sum(A // mid) <= K:
        high = mid
    else:
        low = mid + 1

print(ans)
# Judge status: Accepted
def main():
    N, K = list(map(int, input().split(' ')))
    S = input()
    char_change_cnt = 0
    before_char = S[0]
    for c in S:
        if before_char == c:
            continue
        before_char = c
        char_change_cnt += 1
    char_change_cnt -= min([char_change_cnt, 2 * K])
    print(N - char_change_cnt - 1)


if __name__ == '__main__':
    main()
# Judge status: Accepted
from sys import stdin
n = int(stdin.readline().rstrip())
a = list(map(int,stdin.readline().rstrip().split()))
b = list(map(int,stdin.readline().rstrip().split()))
A = sum(a);B = sum(b)
count_1 = 0
count_2 = 0
total = B-A
for i,j in zip(a,b):
    if i < j:
        count_1 += (j-i+1)//2
    else:
        count_2 += i-j
count = max(count_1,count_2)
if count <= total:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n, k, *p = map(int, open(0).read().split())

q = []
for p_i in p:
  q.append((p_i+1)/2)
  
s = [0]
pre_s = 0
for q_i in q:
  pre_s += q_i
  s.append(pre_s)

ans = 0
for i in range(n-k+1):
  if ans < (s[i+k] - s[i]):
    ans = s[i+k] - s[i]
    
print(ans)
# Judge status: Wrong Answer
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
for k in range(M):
    x, y, c = map(int, input().split())
    ans = min((min(a) + min(b)), ((a[x - 1] + b[y - 1]) - c))
print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split())

if a <= c <= b or b <= c <= a:
   print("Yes")
else:
   print("No")
# Judge status: Accepted
N, A, B = map(int, input().split())
if ((B-A)%2 == 0):
  print((B-A)//2)
else: 
  print(min([A+(B-A-1)//2 ,N-B+ 1 +(B-A-1)//2]))
# Judge status: Accepted
N, A, B, C, D = map(int, input().split())
S = input()


#%%
flag = True
# A -> Cの間に#が二連続するパターン
if '##' in S[A-1:C]:
    flag = False
# B -> Dの間に#が二連続するパターン
if '##' in S[B-1:D]:
    flag = False

# A, Bの位置交換が必要な時
if C > D:
    if '...' not in S[B-2:D+1]:
    # B,Dの間に連続する3つの'.'が必要
        flag = False

if flag:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
s = (input())
if int(s[0:3]) <= 2019 and int(s[5:6]) <= 4 and int(s[8:9]) <= 30:
  print("Heisei")
else:
  print("TBD")
# Judge status: Accepted
a=int(input().replace(" ",""))
print("Yes" if a==int(a**0.5)**2 else "No")
# Judge status: Accepted
_ = int(input())
lp = list(map(int, input().split()))

m = 10 ** 6
answer = 0
for p in lp:
    m = min(m, p)
    answer += int(p <= m)

print(answer)
# Judge status: Accepted
s = input()
n = len(s)
m = 1000
for i in range(n-2):
    t = int(s[i]+s[i+1]+s[i+2])
    m = min(m, abs(753-t))
print(m)
# Judge status: Accepted
def main():
    N, K = map(int, input().split())
    p = list(map(int, input().split()))
    p.sort()
    return sum(p[:K])
print(main())
# Judge status: Wrong Answer
S = input()
a_list = list(S)
a_ct = 0
b_ct = 0
c_ct = 0

for i in range(0,3):
    if a_list[i] == 'a':
        a_ct = a_ct + 1

for i in range(0,3):
    if a_list[i] == 'b':
        b_ct = b_ct + 1

for i in range(0,3):
    if a_list[i] == 'c':
        c_ct = c_ct + 1
# Judge status: Accepted
def main():
    k = int(input())
    n = 7
    if k % 2 == 0:
        print(-1)
    else:
        for i in range(10 ** 7):
            if n % k == 0:
                print(i + 1)
                break
            n = (10 * n + 7) % k
        else:
            print(-1)


if __name__ == '__main__':
    main()
# Judge status: Accepted
N,M = map(int,input().split())
X = []
for i in range(N):
  a,b = map(int,input().split())
  X.append((a,b))
C = []
for i in range(M):
  c,d = map(int,input().split())
  C.append((c,d))
ans = [0 for _ in range(N)]
INF = float("inf")
for i in range(N):
  MIN = INF
  check = -1
  for y in range(M):
    temp = abs(X[i][0]-C[y][0]) + abs(X[i][1]-C[y][1])
    if temp < MIN:
      MIN = temp
      check = y+1
  ans[i] = check
print(*ans,sep="\n")
# Judge status: Wrong Answer
n=int(input())

if n<1000:
  print('{}{:0=3}'.format('ABC',n))
else:
  print('{}{:0=3}'.format('ABD',n-999))
# Judge status: Accepted
import sys
n = int(input())
a = list(map(int, input().split()))

if 0 in a:
    print(0)
    sys.exit()

ans = 1
for ai in a:
    ans = ans * ai
    if ans > 10 ** 18:
        print(-1)
        sys.exit()
print(ans)
# Judge status: Accepted
import sys
from bisect import bisect_left

input = sys.stdin.readline


def main():
    N = int(input())
    L = list(map(int, input().split()))

    L.sort()
    ans = 0
    for i in range(N - 1):
        a = L[i]
        for j in range(i + 1, N):
            k = bisect_left(L, a + L[j])
            ans += (k - 1 - j)

    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
from collections import Counter
N = int(input())
stics = [int(i) for i in input().split()]

c = Counter(stics)

cnt = [k for k, v in c.items() if v >= 2]

if len(cnt) < 2:
    print(0)
else :
    cnt = sorted(cnt, reverse=True)
    print(cnt[0] * cnt[1])
# Judge status: Accepted
a,b=map(int,input().split())
if (a+b)%2 is not 0:
   print('IMPOSSIBLE')
else:
   print((a+b)//2)
# Judge status: Accepted
N, A, B, C, D = [int(_) for _ in input().split()]
S = input()

if "##" in S[A-1:C] or "##" in S[B-1:D]:
    print("No")
elif C < D:
    print("Yes")
elif "..." in S[B-2:D+1]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
#A,B,C=map(float,input().split())
#a,b,c=map(int,input().split())
N=int(input())
Lm=2
Ln=1
Lo=2
if N==0:
	print(2)
elif N==1:
	print(1)
else:
	for i in range(N-1):
		Lo=Lm+Ln
		Lm=Ln
		Ln=Lo
	print(Lo)
# Judge status: Accepted
abc = list(map(int, input().split()))
k = int(input())
mx = max(abc)
x2 = mx
for i in range(k):
    x2 *= 2
print(x2 + sum(abc) - mx)
# Judge status: Wrong Answer
def uclid(x, y):
    if(y == 0):
        return x
    return uclid(y, x%y)

def main():
    N = int(input())
    A = list(map(int, input().split()))
    
    A.insert(0, A[N-1])
    tmp = [0]*(N-1)
    for i in range(N-1):
        tmp[i] = uclid(A[i], A[i+1])+uclid(A[i+1], A[i+2])    
    index_min = tmp.index(min(tmp))
    tmp.pop(index_min)
    print(min(tmp)-uclid(A[index_min+1], A[index_min+2]) if N > 2 else uclid(A[0], A[1]))
main()
# Judge status: Accepted
import fractions
N = int(input())
T = [int(input()) for _ in range(N)]
ans = T[0]
for i in range(1, N):
    ans = (ans * T[i]) // fractions.gcd(ans, T[i])

print(ans)
# Judge status: Wrong Answer
import sys
n = int(input())
ln = [64, 32, 16, 8, 4, 2, 0]
for i in ln:
    if i <= n:
        print(i)
        sys.exit()
# Judge status: Wrong Answer
import numpy as np

n = int(input())
a = np.array(list(map(int,input().split())))

b = a[a <= 0]
a = np.abs(a)
s = np.sum(a)
if(len(b)%2==1):
    a = np.sort(a)
    s -= a[0]
print(s)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
x = int(input())
print((a + 1) * (b + 1) * (c + 1))
# Judge status: Accepted
x, k, d = map(int, input().split())
x = abs(x)
if x >= k * d:
    print(x - k * d)
else:
    cnt = x // d
    if cnt % 2 == k % 2:
        point = x - x // d * d
    else:
        point = x - (x // d + 1) * d
    print(abs(point))
# Judge status: Accepted
m,n = map(int, input().split())
road_dict = {k+1:0 for k in range(m)}
for _ in range(n):
  i, j = map(int, input().split())
  road_dict[i] += 1
  road_dict[j] += 1
for v in road_dict.values():
  print(v)
# Judge status: Accepted
import sys
from io import StringIO
import unittest
import math

def resolve():
    s,c= map(int,input().split())

    if s>=c/2:
        print(str(math.floor(c/2)))
    else:
        zanc = c - (s * 2)
        print(str(s + math.floor(zanc/4)))
        
resolve()
# Judge status: Accepted
n = int(input())
a = list(int(i) for i in input().split())

ans = "APPROVED"
for i in range(n):
    if ans =="APPROVED":
        if a[i]%2 == 0:
            b = a[i]%3
            c = a[i]%5
            if b == 0 or c == 0:
                ans = "APPROVED"
            else: 
                ans = "DENIED"
    else:
        ans = "DENIED"
print(ans)
# Judge status: Accepted
from decimal import Decimal,getcontext
A,B=input().split()
getcontext().rounding
print(int(Decimal(A)*Decimal(B)))
# Judge status: Accepted
import sys

input = sys.stdin.readline

def main():
    s = input().rstrip('\n')
    n = len(s)
    ansl = [0]*(n+1)
    for i in range(n):
        if s[i] == '<':
            ansl[i+1] = ansl[i]+1
    for i in reversed(range(n)):
        if s[i] == '>':
            ansl[i] = max(ansl[i+1]+1,ansl[i])
    print(sum(ansl))

if __name__ == '__main__':
    main()
# Judge status: Accepted
S = input()
K = int(input())
if S[0] == '1':
    if K == 1:
        print('1')
    else:
        for i in range(1, len(S)):
            if S[i] != '1':
                break
        if i <= K - 1:
            print(S[i])
        else:
            print('1')
else:
    print(S[0])
# Judge status: Accepted
o = str(input())
e = str(input())
length = min(len(o), len(e))
ans = ""
for i in range(length):
  ans = ans + o[i] + e[i]
if len(o) > len(e):
  ans += o[length]
elif len(e) > len(o):
  ans += e[length]
print(ans)
# Judge status: Accepted
n = int(input())
S = [str(input()) for _ in range(n)]

d = {}
ans = 0
for i in range(n):
    s = S[i]
    s = list(s)
    s.sort()
    s = ''.join(s)
    if s in d:
        ans += d[s]
    if s in d:
        d[s] += 1
    else:
        d[s] = 1
print(ans)
# Judge status: Wrong Answer
n = int(input())
if n > 1000:
  print("ABD")
else:
  print("ABC")
# Judge status: Wrong Answer
n=int(input())
s = [input() for i in range(n)]
num = 0
for i in range(len(s)):
    if str(s[i]) != str(s[i-1]) or not i-1:
        num = num + 1

print(num)
# Judge status: Wrong Answer
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
def avg_tmp(t, x):
  return t- x*0.006
ans, ans_index = 10000000, 0
for i in range(n):
  if abs(avg_tmp(t, h[i]) -a) < abs(ans-a):
         ans = abs(avg_tmp(t, h[i]))
         ans_index = i+1
print(ans_index)
# Judge status: Wrong Answer
from itertools import combinations

N = int(input())
L = list(map(int, input().split()))

ans = 0
for i, j, k in combinations(range(N),3):
  ell = sorted([L[i], L[j], L[k]])
  if ell[2] < ell[0] + ell[1] and ell[0] != ell[1]:
    ans += 1
print(ans)
# Judge status: Accepted
n=int(input())

a=[]
b=[]
for i in range(n):
  x,y=map(int,input().split())
  a.append([x+y,x,y])
  b.append([x-y,x,y])
a.sort()
b.sort()
ans=abs(a[0][1]-a[n-1][1])+abs(a[0][2]-a[n-1][2])
aa=abs(b[0][1]-b[n-1][1])+abs(b[0][2]-b[n-1][2])
print(max(ans,aa))
# Judge status: Accepted
k=int(input())
a,b=map(int,input().split())

for i in range(a,b+1):
    if i%k==0:
        print("OK")
        exit()
    else:
        i+=1
print("NG")
# Judge status: Wrong Answer
import collections
import numpy as np

N = int(input())
A = sorted([int(i) for i in input().split()])
a = collections.Counter(A)
A = np.array([i[0] for i in a.items() if i[1] == 1])

ans = 0
while len(A) > 0:
    if len(A) == 1:
        ans += 1
    elif A[0] != A[1]:
        ans += 1
    n = A[0]
    A = A[np.where(A % n != 0)[0]]
    
print(ans)
# Judge status: Accepted
n=int(input())

if n%2==1:
    print((n//2+1)/n)
else:
    print(0.5)
# Judge status: Accepted
n,m,*a=map(int,open(0).read().split())
a.sort()
b=[i-j for i,j in zip(a[1:],a)]
b.sort()
print(sum(b[:max(0,m-n)]))
# Judge status: Wrong Answer
from bisect import *
N = int(input())
A = sorted(list(map(int,input().split())))
print(A[-1],A[bisect_left(A,A[-1]/2)])
# Judge status: Wrong Answer
S = input()
L = len(S)


for i in range(L):
    count = 0
    for j in range(i, L):
        if (i == 0 and count == 0):
            s = S[1:]
        elif(i == L - 1):
            s = S[:i]
        else:
            s = S[:i] + S[i + count + 1:]

        if (s == 'keyence'):
            print('YES')
            exit()
        else:
            count += 1

print('NO')
# Judge status: Accepted
n,l = map(int,input().split())
a = []
for i in range(1,n+1):
  a.append(l+i-1) 
b = []
for i in a:
  b.append(abs(i))
m = min(b)
i = b.index(m)
del a[i]
print(sum(a))
# Judge status: Wrong Answer
count = int(input())

strlist = []
for i in range(count):
  strlist.append(input())

for i in range(count - 1):
  for j in range(i + 1, count):
    if strlist[i] > strlist[j]:
      tmp = strlist[i]
      strlist[i] = strlist[j]
      strlist[j] = tmp

duplication = 0
for i in range(count - 1):
  if strlist[i] == strlist[i + 1]:
    duplication += 1
    
print(strlist)
print(count - duplication)
# Judge status: Accepted
n = int(input())
stations = []
for _ in range(n-1):
    stations.append(tuple(map(int, input().split())))

outputs = [0] * n
for i in range(n-1):
    t = 0
    for j in range(i, n-1):
        c, s, f = stations[j]
        if t <= s:
            t = s
        else:
            if t%f != 0:
                t = t+f - t%f
        t += c
    print(t)
print(0)
# Judge status: Accepted
x, a, b = map(int, input().split())

if a >= b :
	print("delicious")
elif b - a <= x:
	print("safe")
else:
	print("dangerous")
# Judge status: Accepted
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
    from math import floor, ceil
    #from operator import itemgetter

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

    a = list(map(int, input().split()))
    if sum(a)>=22:
        print('bust')
    else:
        print('win')

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a=int(input())
b=[]
c=""
for i in range(a):
    b.append(str(input()))
for j in range(a-1):
    if b[j][-1]==b[j+1][0]:
        if len(set(b))==a:
            c="Yes"
        else:
            c="No"
            break
    else:
        c="No"
print(c)
# Judge status: Accepted
a, b = map(int, input().split())
if a > 8 or b > 8:
    print(':(')
else:
    print('Yay!')
# Judge status: Accepted
import math
n,k=map(int,input().split())
num=n//k
n=n-num*k
ans=min(abs(k-n),n)
print(ans)
# Judge status: Wrong Answer
A,B = map(int,input().split())
if A > B :
    print( 2*A - 1 )
if A == B :
    print( A + B )
else :
    print( 2*B - 1 )
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0

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

if n*m == 1:
    print(1)
elif n == 1 or m == 1:
    print(max(n, m)-2)
else:
    print((n-2)*(m-2))
# Judge status: Accepted
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
      
print(num2alpha(int(input())).lower())
# 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
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

n = int(input())
ans = num2alpha(n).lower()
print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
ans = "NO"
for i in range(b):
    if a*i % b == c:
        ans = "YES"
        break

print(ans)
# Judge status: Wrong Answer
n = int(input())
result = "Yes"
w = list(input())
for i in range(n - 1):
  s = input()
  if s in w:
    result = "No"
    break
  elif s[0] != w[-1][-1]:
    result = "No"
    break
  else:
    w.append(s)
print(result)
# Judge status: Accepted
N = int(input())

f = [0] * (N+1)

for i in range(1, N+1):
    cnt = i
    while cnt <= N:
        f[cnt] += 1
        cnt += i

ans = 0

for i in range(1, N+1):
    ans += i*f[i]

print(ans)
# Judge status: Accepted
a, b  = map(int, input().split())

print((a + b + 1)//2)
# Judge status: Accepted
import string
print((sorted(set(string.ascii_lowercase) - set(input())) + ["None"])[0])
# Judge status: Accepted
n=int(input())
a=list(map(int, input().split()))

from collections import Counter
c=Counter(a)

max_a=max(a)
bls=[0]*(max_a+1)
for a_i in a:
    for j in range(a_i, max_a+1, a_i):
        bls[j]+=1
ans=0
for a_i in a:
    if bls[a_i]==1 and c[a_i]==1:
        ans+=1
print(ans)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
sa, sb, sc = a ** (1/2), b ** (1/2), c ** (1/2)
if sa + sb < sc:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
a,b,n = map(int,input().split())
ans = 0
for i in range(1,min(10**7+1,n+1)):
    ans = max(ans,((a * i)//b -a * (i//b)))
print(ans)
# Judge status: Accepted
s = input()

m = 10**18
for i in range(len(s)-2):
    m = min(abs(int(s[i:i+3])-753), m)
print(m)
# Judge status: Accepted
a,b,c=input().split()
if int(a+b+c)%4==0:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
s,w = map(int,input().split())
if w>=s:
  print("unsafe")
else:
  print("safe")
# Judge status: Wrong Answer
n = int(input())

if n < 3:
    exit()

L = sorted([int(x) for x in input().split()])

count = 0

for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            if L[i] != L[j] and L[j] != L[k] and L[i] != L[k] and L[i] + L[j] > L[k]:
                count += 1

print(count)
# Judge status: Wrong Answer
s=input()
for i in range(0,len(s)-1):
  if s[i]==s[i+1]:print('Bad')
else:print('Good')
# Judge status: Wrong Answer
A,B=map(int,input().split())
if A+B<=24:
    print(A+B)
else:
    print(A+B-24)
# Judge status: Accepted
from collections import deque, defaultdict
N, M = map(int, input().split())
D = defaultdict(list)
for i in range(M):
    s, t = map(int, input().split())
    D[s].append(t)
    D[t].append(s)

q = deque()
q.append(1)
d = defaultdict(lambda : float("inf"))
d[1] = 0
while q:
    u = q.popleft()
    for v in D[u]:
        if d[v] == float("inf"):
            d[v] = u
            q.append(v)

if len(d) == N:
    print("Yes")
else:
    print("No")
    exit()
for i in range(2, N+1):
    print(d[i])
# Judge status: Accepted
L,R = list(map(int,input().split()))

ans = 10**9
if R-L >= 2020:
    for i in range(L,L+2019):
        for j in range(L+1,L+2020):
            ans = min(ans,(i*j)%2019)
else:
    for i in range(L,R):
        for j in range(L+1,R+1):
            ans = min(ans,(i*j)%2019)

print(ans)
# Judge status: Accepted
n = int(input())

for i in range(1,3 * int(n ** 0.5)):
    n -= i
    if n < i + 1:
        maximum = i + 1
        no = i + 1 - n
        break

for i in range(maximum):
    if i + 1 == no:
        continue
    print(i + 1)
# Judge status: Accepted
def main():
    n,k = map(int,input().split())
    bi = ''
    while n != 0:
        bi += str(n % abs(k))
        if k < 0:
            n = -(-n // k)
        else:
            n = n // k
    bilast = bi[::-1]
    print(len(bilast))

if __name__ == '__main__':
    main()
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    a=input().split()
    print('A'+a[1][0]+'C')

if __name__ == '__main__':
    main()
# Judge status: Accepted
h,m,H,M,K=map(int,input().split())
t=h*60+m
T=H*60+M
print(T-t-K)
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
l.sort(reverse=True)
s=l[0]
n-=2
for i in range(1,n):
	if n>1:
		s+=l[i]*2
		n-=2
	elif n==1:
		s+=l[i]
		n-=1
	else:
		break
print(s)
# Judge status: Accepted
K, N = map(int, input().split())
A = list(map(int, input().split()))

A.insert(0, A[N-1] - K)
diffs = []
for i in range(1, len(A)):
    diff = A[i] - A[i-1]
    diffs.append(diff)

print(K - max(diffs))
# Judge status: Accepted
n=int(input())
l=[0]*10**7
s=int(n**0.7)+10
for x in range(1,s):
    for y in range(1,s-x):
        for z in range(1,s-x-y):
            l[x*x+y*y+z*z+x*y+y*z+z*x-1]+=1
for i in range(n):
    print(l[i])
# Judge status: Accepted
A, B, K = map(int, input().split())
 
cand = []
for i in range(100,0,-1):
    if A%i == 0 and B%i == 0:
        cand += [i]
    
    
print(cand[K-1])
# Judge status: Accepted
N = input().strip()
if N[0] == '7' or N[1] == '7' or N[2] == '7':
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from decimal import Decimal
L = int(input())
L_ = Decimal(L)/Decimal(3)
print(L_**3)