Harryxun/stf_run huggingface dataset:
n = int(input())
num_list = map(int, input().split())

k = 0
for i in range(len(num_list)):
  if min(num_list[:i+1]) == num_list[i]:
    k += 1
    
print(k)

### FIXED CODE ###

n = int(input())
num_list = [int(i) for i in input().split()]

k = 0
for i in range(len(num_list)):
    if i == 0:
        temp_min = num_list[i]
    else:
        temp_min = min(temp_min, num_list[i])
        
    if i != len(num_list)-1:
        if temp_min == num_list[i]:
            k += 1
    else:
        if temp_min == num_list[i]:
            k += 1
    
print(k)
K = int(input())
A,B = map(int, input().split())
p = 0
for i in range(1000):
    if A <= K*i and k*i <= B:
        p = 1
        break
if p == 1:
    print("OK")
else:
    print("NG")
    


### FIXED CODE ###

K = int(input())
A,B = map(int, input().split())
p = 0
for i in range(1000):
    if A <= K*i and K*i <= B:
        p = 1
        break
if p == 1:
    print("OK")
else:
    print("NG")
# -*- coding: utf-8 -*-
n,m,x,y = map(int,input().split())
xi = list(map(int,input().split()))
yi = list(map(int,input().split()))

xi.append(x)
yi.append(y)

xi.sort()
xi.reverse()
yi.sort()

if xi[0]<yi[0]:
    print("No War")
else:
    print("War")


### FIXED CODE ###

# -*- coding: utf-8 -*-
list1 = list(map(int, input().split()))
list1.sort()
print(10*list1[2]+list1[1]+list1[0])
N, M = map(int, input().split())
num = [input().split() for y in range(N)]


def check(target):
    if not len(target) == N:
        return False
    for x, y in num:
        if not target[int(x)-1] == y:
            return False
    return True


for i in range(1000):
    if check(str(i)):
        print(i)
        exit()

print(-1)


### FIXED CODE ###

N, M = map(int, input().split())
num = [input().split() for y in range(M)]


def check(target):
    if not len(target) == N:
        return False
    for x, y in num:
        if not target[int(x)-1] == y:
            return False
    return True


for i in range(1000):
    if check(str(i)):
        print(i)
        exit()

print(-1)
S = int(input())
s = S % 60
m = S // 60 % 60
h = S // 60 //60
ptint([0][1][2].fomat(h,m,s))

### FIXED CODE ###

S = int(input())

s = S % 60
m = S // 60 % 60
h = S // 60 // 60
print(h,':',m,":",s , sep ="")
#print("{a}:{b}:{c}".format(h,m,s))
S = input()

def check(s):
    n = len(s)
    if n%2 != 0:
        return False
    else:
        s1 = s[:(n//2)]
        s2 = s[(n//2):]
        if s1 == s2:
            return True
        else:
            return False

for i in range(len(S)-1, 0, -2):
    if check(S[:i]):
        ans = len(S[:i])
        break

print(ans)

### FIXED CODE ###

S = input()

def check(s):
    n = len(s)
    if n%2 != 0:
        return False
    else:
        s1 = s[:(n//2)]
        s2 = s[(n//2):]
        if s1 == s2:
            return True
        else:
            return False

for i in range(len(S)-1, 0, -1):
    if check(S[:i]):
        ans = len(S[:i])
        break

print(ans)
import sys
from fractions import gcd
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    a=tuple(map(int,input().split()))
    for x in a:
        if x%2:
            raise Exception
    print(0)

        

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from fractions import gcd
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    a=tuple(map(lambda x:int(x)//2,input().split()))
    t=a[0]
    c=0
    while True:
        if t%2==0:
            c+=1
            t//=2
        else:
            break
    l=a[0]
    for x in a[1:]:
        if x%(2**c)!=0 or x%(2**(c+1))==0:
            print(0)
            exit()
        l=l*x//gcd(l,x)
    print((M+l)//(l*2))

        

if __name__ == '__main__':
    main()
import sys
n = int(input())
a = input()
if n == 2:
  print(abs(int(a[0]-int(a[1]))))
  sys.exit()

key = [0]*(n-1)
for i in range(n-1):
  key[i] = abs(int(a[i])-int(a[i+1]))
key2 = [0]*(n-2)
for i in range(n-2):
  key2[i] = abs(key[i]-key[i+1])

comb = 1
ans = 0
for i in range(n-2):
  ans += comb*key2[i]
  ans %= 2
  comb *= (n-3-i)
  comb *= pow(i+1, 7, 2)
print(ans)

### FIXED CODE ###

import sys
import random
input = sys.stdin.readline


def solve(n, s):
    sub = [int(s[i])-1 for i in range(n)]
    
    table = [0]*(n+1)
    p = 2
    for i in range(len(bin(n))-1):
        for j in range(p, n+1, p):
            table[j] += 1
        p *= 2
    
    for i in range(n):
        table[i+1] += table[i]
    
    ans = 0
    for i in range(n):
        if sub[i]%2:
            judge = table[n-1]-table[n-1-i]-table[i]
            if not judge:
                ans += 1
    
    
    if ans%2:
        res = 1
    else:
        if 1 in sub:
            res = 0
        else:
            res = 0
            for i in range(n):
                if sub[i]:
                    judge = table[n-1]-table[n-1-i]-table[i]
                    if not judge:
                        res += 1
            return res%2*2
    
    return res
    
    
def main():
    n = int(input())
    s = input()
    
    ans = solve(n, s)
    print(ans)
    
    
if __name__ == "__main__":
    main()
a, b, c = int(input().split())
if a + b + c >= 22:
  print('bust')
if a + b + c <= 21:
  print('win')

### FIXED CODE ###

a, b, c = map(int, input().split())
if a + b + c >= 22:
  print('bust')
if a + b + c <= 21:
  print('win')
def yesno(S):
  if S==AAA or S==BBB:
    return No
  else:
    return Yes
  
print(yesno(S))

### FIXED CODE ###

def yesno(S):
  if S=="AAA" or S=="BBB":
    return "No"
  else:
    return "Yes"
  
S=input()
print(yesno(S))
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

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())
rf = lambda: map(float, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

print('test')

### FIXED CODE ###

print((int(input())+int(input()))*int(input())//2)
N, M = [int(x) for x in input().split()]
links = [tuple(map(int, input().split())) for _ in range(M)]
S, T = [int(x) for x in input().split()]

d = {}
for x, y in links:
    if x in d:
        d[x][0].add(y)
    else:
        d[x] = [set([y]), False]

def next_node(start):
    history = set()
    for s in start:
        if s in d:
            history |= d[s][0]
    return history

history = [S]
s = 1
while True:
    for _ in range(3):
        history = next_node(history)
    if T in history:
        print(s)
        break
    for h in list(history):
        if d[h][1]:
            history.remove(h)
        else:
            d[h][1] = True
    if len(history) == 0:
        print(-1)
        break
    s += 1
    

### FIXED CODE ###

N, M = [int(x) for x in input().split()]
links = [tuple(map(int, input().split())) for _ in range(M)]
S, T = [int(x) for x in input().split()]

d = {}
for x, y in links:
    if x in d:
        d[x][0].add(y)
    else:
        d[x] = [{y}, False]

def next_node(start):
    history = set()
    for s in start:
        if s in d:
            history |= d[s][0]
    return history

history = {S}
s = 1
while True:
    for _ in range(3):
        history = next_node(history)
    if T in history:
        print(s)
        break
    for h in tuple(history):
        if h not in d or d[h][1]:
            history.remove(h)
        else:
            d[h][1] = True
    if len(history) == 0:
        print(-1)
        break
    s += 1
n = int(input())
d = sorted(list(map(int,input().split())))
print(d[n//2]-d[n//2-1])

### FIXED CODE ###

#ABC132 = 2*2*3*11
S = input()
A = []
for i in range(len(S)):
    A.append(S[i])
if S[0] == S[1] and S[2] == S[3] or S[0] == S[2] and S[1] == S[3] or S[0] == S[3] and S[1] == S[2]:
    if A.count(S[0]) == 4:
        print("No")
    else:
        print("Yes")
else:
    print("No")
# -*- coding: utf-8 -*-


def main():
    n.l = map(int, input().split())
    s = [input() for _ in range(n)]
    s.sort()
    print(''.join(s))

if __name__ == '__main__':
    main()

### FIXED CODE ###

n, l = map(int, input().split())
s = [input() for _ in range(n)]
s.sort()
print(''.join(s))
s= input()
 
list=[]
for i in s:
  if i == '0':
    list.append('0')
  elif i == '1':
    list.append('1')
  elif i == 'B':
    list.pop(-1)
print(list)

### FIXED CODE ###

s= input()
 
list=[]
for i in s:
  if i == '0':
    list.append('0')
  elif i == '1':
    list.append('1')
  elif i == 'B':
    if len(list) != 0:
      list.pop(-1)
print("".join(list))
N = int(input())


def time(n):
    if n <= 0:
        return 0
    elif n == 1:
        return 1
    else:
        return time(n-1) * n


print(time(N))


### FIXED CODE ###

N = int(input())

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

print(Ans)
n=int(input())
a=list(map(int,input().split()))
c=0
l=[]
for i in range(1,n):
  l.append(a[i]-a[i-1])
p=l.pop(0)
while len(l)!=0:
  if p!=0:
    p=l.pop(0)
  if p==0:
    c+=1
    while len(l)>2:
      if l[0]==0 and l[1]==0:
        p=l.pop(0)
        p=l.pop(0)
        c+=1
      else:
        break
    if l[0]==0:
      p=l.pop(0)
      if len(l)>0:
        p=l.pop(0)
      else:
         break
    else:
      p=l.pop(0)
if p==0:c+=1
print(c)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
c=0
l=[]
for i in range(1,n):
  l.append(a[i]-a[i-1])
if len(l)==1 and l[n-2]==0:c+=1
if len(l)>1 and l[n-2]==0 and l[n-3]!=0:c+=1
p=l.pop(0)
while len(l)!=0:
  if p!=0:
    p=l.pop(0)
  else:
    c+=1
    while len(l)>1:
      if l[0]==0 and l[1]==0:
        p=l.pop(0)
        p=l.pop(0)
        c+=1
      else:
        break
    while len(l)>0:
      if l[0]==0:
        p=l.pop(0)
      else:
        p=l.pop(0)
        break
print(c)
import math as mt
n,k=map(int,input().split())
print(mt.ceil(mt.log(n,k))


### FIXED CODE ###

x,k=map(int,input().split())
ans=0
while k**ans<=x:
  ans+=1

print(ans)
import math

lst = []
min_1 = "9"
for i in range(5):
    s = input()
    lst.append(s)
    if s[-1] != "0" and s[-1] < min_1[-1]:
        min_1 = s
lst.remove(min_1)
a = list(map(lambda x:math.ceil(int(x)/10)*10,lst))
print(sum(a) + int(min_1))


### FIXED CODE ###

just=[]
left=[]
for i in range(5):
  a=int(input())
  if a%10 == 0:
    just.append(a)
  else:
    left.append(a)
_sum = sum(just)    
_min=10
index=-1
for i in range(len(left)):
  i1=left[i]%10
  if _min > i1:
    _min = i1
    index = i
for i in range(len(left)):
  if i == index:
    _sum += left[i]
  else:
    b=left[i]%10
    _sum += left[i] + (10-b)
print(_sum)
a, b, c, d, e, f= (int(i) for i in input().split()) 

waterlist=[]
for i in range(0,f+100*a,100*a):
  for j in range(0,f+100*b,100*b):
    if i+j <=f:
      waterlist+=[i+j]
waterlist=list(set(waterlist))
#print(x)

sugarlist=[]
for i in range(int(f/c)+1):
  for j in range(int(f/d)+1):
    if c*i+d*j <=f:
      sugarlist+=[c*i+d*j]
sugarlist=list(set(sugarlist))
#print(y)

density=0
ans1=101
ans=1
for i in range(len(waterlist)):
  for j in range(len(sugarlist)):
    if 0 < waterlist[i]+sugarlist[j] <= f and sugarlist[j]<=waterlist[i]/100*e:
      tmp=sugarlist[j]/(waterlist[i]+sugarlist[j])
      if density < tmp:
        density = tmp
        ans1=waterlist[i]+sugarlist[j]
        ans2=sugarlist[j]
        
print(ans1,ans2)


### FIXED CODE ###

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

waterlist=[]
for i in range(0,f+100*a,100*a):
  for j in range(0,f+100*b,100*b):
    if i+j <=f:
      waterlist+=[i+j]
waterlist=list(set(waterlist))
#print(x)

sugarlist=[]
for i in range(int(f/c)+1):
  for j in range(int(f/d)+1):
    if c*i+d*j <=f:
      sugarlist+=[c*i+d*j]
sugarlist=list(set(sugarlist))
#print(y)

density=0

for i in range(len(waterlist)):
  for j in range(len(sugarlist)):
    if 0 < waterlist[i]+sugarlist[j] <= f and sugarlist[j]<=waterlist[i]/100*e:
      tmp=sugarlist[j]/(waterlist[i]+sugarlist[j])
      if density <= tmp:
        density = tmp
        ans1=waterlist[i]+sugarlist[j]
        ans2=sugarlist[j]
        
print(ans1,ans2)
A, B, N = map(int,input().split())

x = N
for x in reversed(range(1,N+1)):
  if x % B != 0:
    print(int(A*x/B)-A*int(x/B))
    exit()

print(0)

### FIXED CODE ###

K = int(input())
A, B = map(int,input().split())

for i in range(A,B+1):
  if i % K == 0:
    print("OK")
    exit()
    
print("NG")
import sys
sys.setrecursionlimit(10*6)

def m():
    n, m = map(int, input().split())
    p = list(map(int, input().split()))
    g = [[] for _ in range(n+1)]
    for _ in range(m):
        x, y = map(int, input().split())
        g[x].append(y)
        g[y].append(x)
    color = [-1] * (n+1)

    def dfs(v, c):
        s = []
        s.append(v)
        color[v] = c
        while len(s) != 0:
            a = s.pop()
            for elem in g[a]:
                if color[elem] == -1:
                    dfs(elem, c)

    k = 0
    for i in range(1, n):
        if color[i] == -1:
            dfs(i,k)
            k +=1
    ans = 0
    for i in range(n):
        if color[p[i]] == color[i+1]:
            ans +=1
    return ans

print(m())

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

def m():
    n, m = map(int, input().split())
    p = list(map(int, input().split()))
    g = [[] for _ in range(n+1)]
    for _ in range(m):
        x, y = map(int, input().split())
        g[x].append(y)
        g[y].append(x)
    color = [-1] * (n+1)

    def dfs(v, c):
        s = []
        s.append(v)
        color[v] = c
        while len(s) != 0:
            a = s.pop()
            for elem in g[a]:
                if color[elem] == -1:
                    dfs(elem, c)

    k = 0
    for i in range(1, n):
        if color[i] == -1:
            dfs(i,k)
            k +=1
    ans = 0
    for i in range(n):
        if color[p[i]] == color[i+1]:
            ans +=1
    return ans

print(m())
from sys import stdin

n = stdin.readline().rstrip()
a = [int(x) for x in stdin.readline().rstrip().split()]

count = 0
b = a[0]
while True:
    if b % 2 == 1: break
    b = b//2
    count = count + 1
minc = count

for b in a[1:]:
  	count = 0
    while True:
        if b % 2 == 1: break
        b = b//2
        count = count + 1

    minc = min([minc, count])

print(minc)

### FIXED CODE ###

from sys import stdin

n = stdin.readline().rstrip()
a = [int(x) for x in stdin.readline().rstrip().split()]

minc = 10**9

for b in a:
    count = 0
    while True:
        if b % 2 == 1: break
        b = b//2
        count = count + 1

    minc = min([minc, count])

print(minc)
S = input()
N = len(S)

if S = S[::-1]:
  if S[:(n-1)//2] == S [(n+1)//2:]:
    print("Yes")
  else:
    print("No")
else:
  print("No")

### FIXED CODE ###

S = input()
N = len(S)

if S == S[::-1]:
  if S[:(N-1)//2] == S [(N+1)//2:]:
    print("Yes")
  else:
    print("No")
else:
  print("No")
n, a, b = map(int, input().split())

from math import factorial
ans = 0

if n % 2 == 1:
    for i in range(1, n // 2 + 1):
        ans += factorial(n) // factorial(i) // factorial(n - i)
    ans *= 2 + 1
else:
    for i in range(1, n // 2):
        ans += factorial(n) // factorial(i) // factorial(n - i)
    ans *= 2
    ans += factorial(n) // factorial(n // 2) // factorial(n - n // 2) + 1

ans -= factorial(n) // factorial(a) // factorial(n - a)
ans -= factorial(n) // factorial(b) // factorial(n - b)
print(ans)

### FIXED CODE ###

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

if n >= 10:
  print(r)
else:
  print(r +  100 * (10 - n))
N = int(input())
A = input().split()
flag = 1
A.sort()

for i in range(N):
	if A[i] == A[i+1]:
		flag = 0
		break
if flag==0:
	print('NO')
elif flag==1:
	print('YES')



### FIXED CODE ###

N = int(input())
A = input().split()
flag = 1
A.sort()

for i in range(N-1):
	if A[i] == A[i+1]:
		flag = 0
		break
if flag==0:
	print('NO')
elif flag==1:
	print('YES')
S = input()
S1 = list(S)
i = 0

if ((S1[1] == 'C') or (S1[-1] == 'C')):
    print('WA')
elif ((S1[0] == 'A') and (S1[2:-1].count('C') == 1)):
    S1.remove('A')
    S1.remove('C')
    while i <= len(S1):
        if S1[i].isupper():
            print('WA')
            i += 1
        break
    else:
        print('AC')

### FIXED CODE ###

R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')
a,b,c = map(int, input().split())
cnt = 0
for i in range(a,b+1)
 if c%i == 0 : cnt += 1
print(cnt)
  

### FIXED CODE ###

a,b,c = map(int, input().split())
cnt = 0
for i in range(a,b+1):
 if c%i == 0 : cnt += 1
print(cnt)
import copy
N = int(input())
a = [input() for i in range(N)]
b = copy.deepcopy(a)
for i in b:
    del b[i]
    print(max(b))
    b = copy.deepcopy(a)

### FIXED CODE ###

hankei = int(input())
ans = 3*(hankei*hankei)
print(ans)
N = int(input())
nums = input().split()
costs = []
if nums.count(nums[0]) != len(nums):
    for i in range(-100, 101):
        sum = 0
        for num in nums:
            sum += (int(num) - i) ** 2
        costs.append(sum)
    ans = min(costs)
else:
    ans = 0
print(ans)

### FIXED CODE ###

count = int(input())
answer = 0
for i in range(1, count + 1):
    answer = answer + i
print(answer)
n,k,*v=map(int,open(0).read().split())
m=0
r=range
for i in r(n+1):
 for j in r(min(k,n)-i+1):
  t=sorted(v[:i]+v[-j:]*(j>0))[::-1];c=k-i-j
  while c*t[-1]<0:t.pop();c-=1
  m=max(m,sum(t))
print(m)

### FIXED CODE ###

n,k,*v=map(int,open(0).read().split())
m=0
r=range
for i in r(n+1):
 for j in r(min(k-i+1,n-i+1)):
  t=sorted(v[:i]+v[-j:]*(j>0))[::-1];c=k-i-j
  while t and c and t[-1]<0:t.pop();c-=1
  m=max(m,sum(t))
print(m)
# -*- coding: utf-8 -*-
# 整数の入力
R = int(raw_input())
G = int(raw_input())
print (2*G) - R


### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
r = int(input())
g = int(input())
print (2 * g - r)
import sys

def solve():
    N = int(sys.stdin.readline().rstrip())
    A = list(map(int,sys.stdin.readline().rstrip().split()))
    A = sorted(A, reverse=True)
    maxA = A[0]
    cntA = [0] * (maxA+1)
    for a in A:
        cntA[a] += 1

    ans = 0
    twos = 1 << 32
    for a in A:
        if a <= 2:
            return ans
        if cntA[a] == 0:
            continue
        cntA[a] -= 1
        #print('a =',a)
        while True:
            b = twos - a
            #print('b =',b)
            if b <= a:
                break
            twos //= 2
            if twos == 1:
                return ans
        if cntA[b] > 0:
            cntA[b] -= 1
            ans += 1
    return ans

print(solve())


### FIXED CODE ###

import sys
import collections

def solve():
    N = int(sys.stdin.readline().rstrip())
    A = list(map(int,sys.stdin.readline().rstrip().split()))
    A = sorted(A, reverse=True)
    maxA = A[0]
    cntA = collections.Counter(A)

    ans = 0
    for a in A:
        if cntA[a] == 0:
            continue
        cntA[a] -= 1
        #print('a =',a)
        b = (1 << a.bit_length()) - a
        if cntA[b] > 0:
            cntA[b] -= 1
            ans += 1
    return ans

print(solve())

#  1  1  7   9
#     3  5   11
#        13
#     15
#  2  6  10
#     14
#  4  4  12
#
#  8
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import copy
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

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

N = getN()
V = getList()

# 条件を満たすもののうちで最も多く現れる多い２数を採用する方針
even = [0] * (200 + 1)
odd = [0] * (200 + 1)
for i in range(N):
    if i % 2 == 0:
        even[V[i]] += 1
    else:
        odd[V[i]] += 1
# 偶数列、奇数列に現れる数字の中で一番多かったもの
topeven = even.index(max(even))
topodd = odd.index(max(odd))
even.sort()
odd.sort()

ans = 0
if topeven == topodd:
    # 偶数列で一番多かった数、奇数列で２番目に多かった数
    opt1 = N - even[-1] - odd[-2]
    # 偶数列で２番目に多かった数、奇数列で一番多かった数
    opt2 = N - even[-2] - odd[-1]
    # どちらか小さい方
    ans = min(opt1, opt2)
else:
    ans = N - even[-1] - odd[-1]
print(ans)

### FIXED CODE ###

def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import copy
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

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

N = getN()
V = getList()

# 条件を満たすもののうちで最も多く現れる多い２数を採用する方針
even = [0] * (10 ** 5 + 1)
odd = [0] * (10 ** 5 + 1)
for i in range(N):
    if i % 2 == 0:
        even[V[i]] += 1
    else:
        odd[V[i]] += 1
# 偶数列、奇数列に現れる数字の中で一番多かったもの
topeven = even.index(max(even))
topodd = odd.index(max(odd))
even.sort()
odd.sort()

ans = 0
if topeven == topodd:
    # 偶数列で一番多かった数、奇数列で２番目に多かった数
    opt1 = N - even[-1] - odd[-2]
    # 偶数列で２番目に多かった数、奇数列で一番多かった数
    opt2 = N - even[-2] - odd[-1]
    # どちらか小さい方
    ans = min(opt1, opt2)
else:
    ans = N - even[-1] - odd[-1]
print(ans)
import fractions

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

if k > max(a):
    print("IMPOSSIBLE")
else:
    minak = min(a)
    for i in range(0,n):
        a[i] -= minak

    gcda = fractions.gcd(a[0],a[1])

    for i in range(0,n):
        gcda = fractions.gcd(gcda,a[i])
        if gcda ==1:
            break

    if gcda == 0 or gcda == 1 or ((k-minak)) % gcda == 0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")

print(fractions.gcd(0,0))

### FIXED CODE ###

import fractions

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

if k > max(a):
    print("IMPOSSIBLE")
elif n == 1:
    if a[0] == k:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
else:
    minak = min(a)

    gcda = fractions.gcd(a[0],a[1])

    for i in range(0,n):
        gcda = fractions.gcd(gcda,a[i])
        if gcda ==1:
            break

    if gcda == 1 or k % gcda == 0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
n  = int(input())
kakuketanowa = sum(map(int, list(str(n))))
if x % kakuketanowa == 0:
	print("Yes")
else:
	print("No")


### FIXED CODE ###

n  = int(input())
kakuketanowa = sum(map(int, list(str(n))))
if n % kakuketanowa == 0:
	print("Yes")
else:
	print("No")
n,m,c = map(int,input().split())
input_b = map(int,input().split())
while True:
  try:
    list_a=list(map(int,input().split()))
    answer = c
    count = 0
    for lista_item in list_a:
      for i in range(len(lista_item)):
        answer += input_b[i] * lista_item[i]
        if answer > 0
          count+=1
    print count
  except:
    break;

### FIXED CODE ###

n,m,c = map(int,input().split())
input_b = list(map(int,input().split()))
a_list=[input() for i in range(n)]
count = 0
for i in range(n):
  answer = c
  aitems = list(map(int,a_list[i].split()))
  for j in range(m):
    answer += input_b[j] * aitems[j]
  if answer > 0:
    count+=1
print(count)
n = int(input())
max_str = sorted(input())
for _ in range(n-1):
    s = sorted(input())
    new_max_str = []
    start_s = 0
    for i in range(len(max_str)):
        if max_str[i] > s[start_s]:
            start_s += 1
        for j in range(start_s, len(s)):
            if max_str[i] <= s[j]:
                if max_str[i] == s[j]:
                    new_max_str.append(s[j])
                    start_s += 1
                break
    max_str = new_max_str.copy()

print("".join(max_str))

### FIXED CODE ###

n = int(input())
s = []
for i in range(n):
    s.append(input())

ans = ""

INF = 1000

for c_i in range(ord('a'), ord('z')+1):
    small = INF
    c = chr(c_i)
    for i in range(n):
        cnt = s[i].count(c)
        small = min(small, cnt)
    ans += c * small

print(ans)