Harryxun/stf_run huggingface dataset:
class dice_2:
    def __init__(self,label):
        self.spots = label

    def result(self,top,front):
        if top == 1:
            self.order=[2,3,5,4,2]
        elif top == 2:
            self.order=[6,3,1,4,6]
        elif top == 3:
            self.order=[2,6,5,1,2]
        elif top == 4:
            self.order=[2,1,5,6,2]
        elif top == 5:
            self.order=[1,3,6,4,1]
        elif top == 6:
            self.order=[2,4,5,3,2]

        for i in range(4):
            if self.order[i] == front:
                self.right = self.order[i+1]

    def output(self):
        print(self.spots[self.right-1])

label = list(map(int,input().split()))
dice = dice_2(label)
for i in range(int(input())):
    top,front = map(int,(input().split()))
    dice.result(top,front)
    dice.output()

### FIXED CODE ###

class dice_2:
    def __init__(self,label):
        self.spots = label

    def result(self,top,front):
        if self.spots.index(top)+1 == 1:
            self.order=[2,3,5,4,2]
        elif self.spots.index(top)+1 == 2:
            self.order=[6,3,1,4,6]
        elif self.spots.index(top)+1 == 3:
            self.order=[2,6,5,1,2]
        elif self.spots.index(top)+1 == 4:
            self.order=[2,1,5,6,2]
        elif self.spots.index(top)+1 == 5:
            self.order=[1,3,6,4,1]
        elif self.spots.index(top)+1 == 6:
            self.order=[2,4,5,3,2]

        for i in range(4):
            if self.order[i] == self.spots.index(front)+1:
                self.right = self.order[i+1]

    def output(self):
        print(self.spots[self.right-1])

label = list(map(int,input().split()))
dice = dice_2(label)
for i in range(int(input())):
    top,front = map(int,(input().split()))
    dice.result(top,front)
    dice.output()
import collections
import fractions

n = int(input())
mod = 10 ** 6 + 7
c = []
d = []

tan = []
atan = []

for _ in range(n):
    a, b = map(int, input().split())
    if b == 0: tan.append(float('inf'))
    else: tan.append(fractions.Fraction(a, b))
    if a == 0: atan.append(float('inf'))
    else: atan.append(fractions.Fraction(-1 * b, a))

tan = collections.Counter(tan)
atan = collections.Counter(atan)

for key, value in tan.items():
    if -1 <= key < 1: continue
    if atan[key] > 0:
        c.append(value)
        d.append(atan[key])

ans = pow(2, n - sum(c) - sum(d), mod)
for i, j in zip(c, d):
    tmp = (pow(2, i, mod) + pow(2, j, mod) - 1)
    ans = (ans * (pow(2, i, mod) + pow(2, j, mod) - 1)) % mod
ans -= 1

print(ans)

### FIXED CODE ###

import collections
import math

n = int(input())
m = 0
mod = 10 ** 9 + 7
c = []
d = []
frac = []

for _ in range(n):
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        n -= 1
        m += 1
        continue
    if a == 0:
        frac.append('0/1')
    elif b == 0:
        frac.append(('1/0'))
    else:
        gcd = abs(math.gcd(a, b))
        sign = 1 if a * b > 0 else -1
        a = sign * abs(a) // gcd
        b = abs(b) // gcd
        frac.append('{}/{}'.format(a, b))

frac = collections.Counter(frac)

def inverse(key):
    if key == '0/1':
        return '1/0'
    elif key == '1/0':
        return '0/1'
    elif key[0] != '-':
        a, b = key.split('/')
        return '-{}/{}'.format(b, a)
    else:
        a, b = key[1:].split('/')
        return '{}/{}'.format(b, a)

for key, value in frac.items():
    if key[0] == '-' or key[0] == '0': continue
    if frac[inverse(key)] > 0:
        c.append(value)
        d.append(frac[inverse(key)])

ans = pow(2, n - sum(c) - sum(d), mod)
for i, j in zip(c, d):
    tmp = (pow(2, i, mod) + pow(2, j, mod) - 1) % mod
    ans = ans * tmp % mod
ans = (ans - 1 + m) % mod

print(ans)
def main():
  n = input()
  print("Yes" if n.count() > 0 else "No")
  

if __name__ == "__main__":
  main()


### FIXED CODE ###

def main():
  n = input()
  print("Yes" if n.count("7") > 0 else "No")
  

if __name__ == "__main__":
  main()
from math import sqrt
v = list(map(int, input().split()))
if (v[0]+v[1]) < v[2]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

x = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(x[int(input())-1])
n,m = map(int,input().split())
S = list(map(str,input().split()))
ac = 0
wa = 0
i = 0
j = 0
while j < n:
  while i < m:
    if S[i] == "AC":
      ac += 1
      i += 1
      j += 1
    else:
      wa += 1
      i += 1
print(ac)
print(wa)

### FIXED CODE ###

N,M = map(int,input().split())
AC = 0
penalty = 0
AC_list = [0]*N
WA_list = [0]*N

for i in range(M):
  p,s = map(str,input().split())
  p = int(p)-1
  if s == "AC" and AC_list[p] == 0:
    AC += 1
    AC_list[p] = 1
    penalty += WA_list[p]
  elif s == "WA":
    WA_list[p] += 1
  if AC == N:
    break
print(AC,penalty)
n, k = map(int, input().split())
As = list(map(int, input().split()))
maps = {}

for i, a in enumerate(As):
    maps[i] = a - 1

probs = [0] * n
p = 0  # 現在位置
target = 0  # はじめて2回出現する場所
h = 0  # ターゲットの初回出現時のワープ回数
t = 0  # ターゲットの2回目の出現時のワープ回数

if (maps(0) == 0):
    print(1)
    exit

# はじめて2回出現する場所(target)と、その時点でのワープ回数を取得
for i in range(n):
    probs[p] += 1
    if (probs[p] == 2):
        target = p
        t = i
        break
    p = maps[p]

# 初回出現位置を取得(めんどうくさいのでもう一回回した。)
p = 0
for i in range(n):
    if (p == target):
        h = i
        break
    p = maps[p]

s = t - h  # 周期
d = (k - h) % s  # targetに到着後にワープすべき回数

# 実際に必要な回数だけワープ
p = 0
for i in range(h + d):
    p = maps[p]

print(p + 1)


### FIXED CODE ###

n, k = map(int, input().split())
As = list(map(int, input().split()))
maps = {}

for i, a in enumerate(As):
    maps[i] = a - 1

probs = [0] * n
p = 0  # 現在位置
target = 0  # はじめて2回出現する場所
h = 0  # ターゲットの初回出現時のワープ回数
t = 0  # ターゲットの2回目の出現時のワープ回数

# はじめて2回出現する場所(target)と、その時点でのワープ回数を取得
for i in range(n + 1):
    probs[p] += 1
    if (probs[p] == 2):
        target = p
        t = i
        break
    p = maps[p]

# 初回出現位置を取得(めんどうくさいのでもう一回回した。)
p = 0
for i in range(n):
    if (p == target):
        h = i
        break
    p = maps[p]

s = t - h  # 周期
if (k <= h):
    p = 0
    for i in range(k):
        p = maps[p]
    print(p + 1)
    exit()

d = (k - h) % s  # targetに到着後にワープすべき回数

# 実際に必要な回数だけワープ
p = 0
for i in range(h + d):
    p = maps[p]

print(p + 1)
while True:
    n = raw_input()
    if n in ['a','e','i','o','u']:
        print 'vowel'
    else:
        print 'consonant'


### FIXED CODE ###

n = raw_input()
if n in ['a','e','i','o','u']:
    print 'vowel'
else:
    print 'consonant'
x, k, d = map(int ,input().split())
ans_min = x

def dfs(i, ans):
  global ans_min
  if abs(ans_min) > abs(ans):
    ans_min = ans
  if i == k:
    return abs(ans_min)
  dfs(i + 1, ans + d)
  dfs(i + 1, ans - d)

dfs(0, x)
print(ans_min)

### FIXED CODE ###

x, k, d = map(int, input().split())

x = abs(x)
straight = min(k, x//d)
k -= straight
x -= straight*d

if k%2 == 0:
  print(x)
else:
  print(d-x)
n=int('enter number')
def doublefactorial(n): 
    if (n == 0 or n == 1): 
        return 1; 
    return n * doublefactorial(n - 2);

def trailing_zeros(longint):
    manipulandum = str(longint)
    return len(manipulandum)-len(manipulandum.rstrip('0'))
  
print("Double factorial is",  
       doublefactorial(n));

print('trailing zeroes are'+ str(trailing_zeros(doublefactorial(n))))



### FIXED CODE ###

n=int(input())
if n%2 == 0:
    num=10
    c=0;
    while num <= n:
        c += (n//num)
        num *= 5
    print(c)
else:
    print(0)
def dijkstra(s):
    #始点sから各頂点への最短距離
    #n:頂点数,　w:辺の数, cost[u][v] : 辺uvのコスト(存在しないときはinf)
    d = [float("inf")] * n
    used = [False] * n
    d[s] = 0
    
    while True:
        v = -1
        #まだ使われてない頂点の中から最小の距離のものを探す
        for i in range(n):
            if (not used[i]) and (v == -1):
               v = i
            elif (not used[i]) and d[i] < d[v]:
                v = i
        if v == -1:
               break
        used[v] = True
               
        for j in range(n):
               d[j] = min(d[j],d[v]+cost[v][j])
    return d

Xs,Ys,Xt,Yt = map(int,input().split())
n = int(input())
p = [([Xs,Ys,0],[Xt,Yt,0]]
for i in range(2,n+2):
    p.append(list(map(int,input().split())))
cost = [[0]*(n+2)for i in range(n+2)]

for i in range(n+2):
    for j in range(i,n+2):
        cost[i][j] = cost[j][i] =  max(((p[i][0]-p[j][0])**2+(p[i][1]-p[j][1])**2)**0.5 - p[i][2] - p[j][2],0)

n += 2

res = dijkstra(0)
print(1)


### FIXED CODE ###

Xs,Ys,Xt,Yt = map(int,input().split())
n = int(input())
p = [(Xs,Ys,0),(Xt,Yt,0)]
for i in range(2,n+2):
    p.append(tuple(map(int,input().split())))
cost = [[0]*(n+2)for i in range(n+2)]

for i in range(n+2):
    for j in range(i,n+2):
        cost[i][j] = cost[j][i] =  max(((p[i][0]-p[j][0])**2+(p[i][1]-p[j][1])**2)**0.5 - p[i][2] - p[j][2],0)
n += 2
s = 0
#始点sから各頂点への最短距離
#n:頂点数,　w:辺の数, cost[u][v] : 辺uvのコスト(存在しないときはinf)
d = [float("inf")] * n
used = [False] * n
d[s] = 0
    
while True:
    v = -1
    #まだ使われてない頂点の中から最小の距離のものを探す
    for i in range(n):
        if (not used[i]) and (v == -1):
           v = i
        elif (not used[i]) and d[i] < d[v]:
            v = i
    if v == -1:
           break
    used[v] = True
           
    for j in range(n):
           d[j] = min(d[j],d[v]+cost[v][j])
print(d[1])
import numpy as np
A, B, C, D, E = [int(input()) for i in range(5)]

x = np.array([A, B, C, D, E])
ans = x.round(-1).sum()
x = x %10
tmp = 10 - x[np.where(x>0)].min()
ans = ans - tmp

print(ans)

### FIXED CODE ###

import numpy as np
A, B, C, D, E = [int(input()) for i in range(5)]

x = np.array([A, B, C, D, E])
ans = int((np.ceil((x / 10)) * 10).sum())
x = x %10

if x.sum()==0:
    tmp = 0
else:
    tmp = 10 - x[np.where(x>0)].min()

ans = ans - tmp

print(ans)
a = int(input())
b = int(input())
c = int(input())


transferrable = a - b

if c <= transferrable:
    c = 0

else:
    c -= transferrable

print(c)


### FIXED CODE ###



res = str(input())

list = res.split(" ")

a = int(list[0])
b = int(list[1])
c = int(list[2])
transferrable = a - b

if c <= transferrable:
    c = 0

else:
    c -= transferrable

print(c)
A,B,C = input().split(' ')
d = int(A/B)
if d > C:
    print(C)
else:
    print(d)

### FIXED CODE ###

A,B,C = input().split(' ')
d = int(int(B)/int(A))
if d > int(C):
    print(int(C))
else:
    print(d)
a, b = map(Int,input().split())
if (a + b) % 2 == 0:
  print((a + b)//2)
else:
  print('IMPOSSIBLE')

### FIXED CODE ###

a, b = map(int,input().split())
if (a + b) % 2 == 0:
  print((a + b)//2)
else:
  print('IMPOSSIBLE')
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

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

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

# Factoring by trial split
def getPrimeList(n):
  l=[]
  t=int(math.sqrt(n))+1
  
  for a in range(2,t):
    while n%a==0:
      n//=a
      l.append(a)
  
  if n!=1:
    l.append(n)
  
  return l

# 10 -> n
def ten2n(a,n):
  x=a//n
  y=a%n
  if x:
    return ten2n(x,n)+str(y)
  return str(y)

# 方針
# 入力値を素因数分解する
# 制約のn<=10^10は、一見巨大に見えるが
# 2^n でさえ（素因数が最大になる場合）
# nは100にすら満たないことが実験するとわかる
# すなわち全探索ができる
# bit全探索を使用して各素数を振り分けを全パターン試す
# 全パターンについて、F(A,B)の最小値を見ていく

def main():
  n=I()

  if n==9876543210:
    exit()

  l=getPrimeList(n)

  l2=[]
  for i in range(pow(2,len(l))):
    l2.append(list(ten2n(i,2).zfill(len(l))))

  mn=inf
  for y in l2:
    a=b=1
    for i in range(len(y)):
      x=y[i]
      if x=='0':
        a*=l[i]
      else:
        b*=l[i]
    mn=min(mn,max(len(str(a)),len(str(b))))

  return mn

print(main())


### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# Factoring by trial split
def getPrimeList(n):
  l=[]
  t=int(math.sqrt(n))+1
  
  for a in range(2,t):
    while n%a==0:
      n//=a
      l.append(a)
  
  if n!=1:
    l.append(n)
  
  return l

def main():
  n=I()
  l=getPrimeList(n)

  mn=len(str(n))
  for i in range(2**len(l)):
    a=n
    b=1
    for j in range(len(l)):
      if ((i>>j)&1):
        a//=l[j]
        b*=l[j]
    mn=min(mn,max(len(str(a)),len(str(b))))

  return mn

# main()
print(main())
#深さ優先探索
N, M = map(int,input().split())
graph = [[] for j in range(N)]
for i in range(M):
  a, b = map(int,input().split())
  graph[a-1].append(b-1)
  graph[b-1].append(a-1)
judge = [False]*N

def dfs(v,judge):#vは今いる場所
  if all(judge):
    return 1
  res = 0
  for nv in graph(v):#vと隣り合っている場所
    if judge[nv] == True:#すでに探索済み
      continue #if文の初めに戻る
    judge[nv] = True
    res += dfs(nv,judge)
    judge[nv] = False
  return res
print(dfs(0,judge))

### FIXED CODE ###

#深さ優先探索
N, M = map(int,input().split())
graph = [[] for j in range(N)]
for i in range(M):
  a, b = map(int,input().split())
  graph[a-1].append(b-1)
  graph[b-1].append(a-1)
judge = [False]*N
judge[0] = True

def dfs(v,judge):#vは今いる場所
  if all(judge):
    return 1
  res = 0
  for nv in graph[v]:#vと隣り合っている場所
    if judge[nv]:#すでに探索済み
      continue #if文の初めに戻る
    judge[nv] = True
    res += dfs(nv,judge)
    judge[nv] = False
  return res
print(dfs(0,judge))
s = sorted(list(input()))
if s[0] == s[1] and s[2] == s[3]:
    print('Yes')
elif s[0] == s[1] and s[0] == s[2]
    print('No')
else:
    print('No')

### FIXED CODE ###

s = sorted(list(input()))
if s[0] == s[1] == s[2] == s[3]:
    print('No')
elif s[0] == s[1] and s[2] == s[3]:
    print('Yes')
else:
    print('No')
import math
a, b, h, m = map(int, input().split())
time = m + h*60
angle = time * 0.5 - time * 6
radian = math.radians(angle)
rad = math.cos(radian)
ans = a**2 + b**2 - 2*a*b*rad
print(math.sqrt(ans))

### FIXED CODE ###

n = str(input())
if n[-1] == "2" or n[-1] == "4" or n[-1] == "5" or n[-1] == "7" or n[-1] == "9":
    print("hon")
elif n[-1] == "0" or n[-1] == "1" or n[-1] == "6" or n[-1] == "8":
    print("pon")
else:
    print("bon")
import sys
from collections import Counter

# sys.stdin = open('c1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    n = read_int()
    a = read_int_list()
    a.sort()
    c = Counter(a)
    l = set()
    for i in a:
        if c[i] >= 2:
            l.add(i)
    l = list(l)
    l.sort()

    res = 0
    if len(l) >= 1:
        m = l[-1]
        if c[m] >= 4:
            res = m * m
        else:
            if len(l) >= 2:
                p = l[-2]
                res = m * p
    print(res)
import sys
from collections import Counter

# sys.stdin = open('c1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    n = read_int()
    a = read_int_list()
    a.sort()
    c = Counter(a)
    l = set()
    for i in a:
        if c[i] >= 2:
            l.add(i)
    l = list(l)
    l.sort()

    res = 0
    if len(l) >= 1:
        m = l[-1]
        if c[m] >= 4:
            res = m * m
        else:
            if len(l) >= 2:
                p = l[-2]
                res = m * p
    print(res)


main()


main()


### FIXED CODE ###

import sys
from collections import Counter

# sys.stdin = open('c1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    n = read_int()
    a = read_int_list()
    a.sort()
    c = Counter(a)
    l = set()
    for i in a:
        if c[i] >= 2:
            l.add(i)
    l = list(l)
    l.sort()

    res = 0
    if len(l) >= 1:
        m = l[-1]
        if c[m] >= 4:
            res = m * m
        else:
            if len(l) >= 2:
                p = l[-2]
                res = m * p
    print(res)


main()
import math
a, b = map(int, input().split())
p = math.gcd(a, b)
print(b * (a // p))


### FIXED CODE ###

from fractions import gcd
a, b = map(int, input().split())
p = gcd(a, b)
print(b * (a // p))
N = int(input())
data = [[0 for i in range(3)] for j in range(N)]
for i in range(N):
    data[i][0],data[i][1],data[i][2] = [int(s) for s in input().split()]

fl = 0
for Cx in range(0,101):
    for Cy in range(0,101):
        s1 = abs(data[0][0]-Cx)+abs(data[0][1]-Cy)+data[0][2]
        for i in range(1,N):
            s2 = abs(data[i][0]-Cx)+abs(data[i][1]-Cy)+data[i][2]
            if s1 != s2:
                break
        else:
            H = s1
            cx = Cx
            cy = Cy
            fl = 1
        if fl:
            break
    if fl:
        break

print(cx,cy,H)
                
            
        
    
    
      

### FIXED CODE ###

N = int(input())
data = [[0 for i in range(3)] for j in range(N)]
for i in range(N):
    data[i][0],data[i][1],data[i][2] = [int(s) for s in input().split()]


for p in data:
    if p[2] != 0:
        base_x = p[0]
        base_y = p[1]
        base_height = p[2]


for Cx in range(0,101):
    for Cy in range(0,101):
        height = abs(base_x-Cx)+abs(base_y-Cy)+base_height
        for p in data:
            if p[2] != max([height-abs(Cx-p[0])-abs(Cy-p[1]),0]):
                break
        else:
            print(str(Cx)+' '+str(Cy)+' '+str(height))
            exit()
input a
print "%d" % (a * a * a)

### FIXED CODE ###

print(int(input())**3)
l, m, n = map(int,input().split())
a = [[0 for i in range(m)] for j in range(l)]
b = [[0 for i in range(n)] for j in range(m)]
c = [[0 for i in range(n)] for j in range(l)]

for i in range(l):
 a[i] = [int(x) for x in input().split()]

for i in range(m):
 b[i] = [int(x) for x in input().split()]

for i in range(l):
 for j in range(n):
  for k in range(m):
   c[i][j] += a[i][m] * b[m][j]
 print(" ".join([str(x) for x in c[i]]))

### FIXED CODE ###

l, m, n = map(int,input().split())
a = [[0 for i in range(m)] for i in range(l)]
b = [[0 for i in range(n)] for i in range(m)]
c = [[0 for i in range(n)] for i in range(l)]

for i in range(l):
 a[i] = [int(x) for x in input().split()]

for i in range(m):
 b[i] = [int(x) for x in input().split()]

for i in range(l):
 for j in range(n):
  for k in range(m):
   c[i][j] += (a[i][k] * b[k][j])
 print(" ".join([str(x) for x in c[i]]))
from collections import Counter
from sys import exit

n = input()
v_array = list(map(int,input().split()))
 
v_odd = v_array[0::2]
v_even = v_array[1::2]
 
v_odd_common = Counter(v_odd).most_common()
v_even_common = Counter(v_even).most_common()

if len(set(v_array)) == 1:
    print(int(len(v_array)/2))
    exit()

for i in range(0,min(len(v_odd_common),len(v_even_common))):
    if v_odd_common[i] == v_even_common[i]:
        if v_odd_common[i+1][1] > v_even_common[i+1][1]:
            v_odd_common_candidate = v_odd_common[i][1]
            v_even_common_candidate = v_even_common[i+1][i]
            break
        elif v_odd_common[i+1][1] < v_even_common[i+1][1]:
            v_odd_common_candidate = v_odd_common[i+1][1]
            v_even_common_candidate = v_even_common[i][i]
            break
        else:
            v_odd_common_candidate = v_odd_common[i][1]
            v_even_common_candidate = v_even_common[i][i]
            break
    else:
        v_odd_common_candidate = v_odd_common[0][1]
        v_even_common_candidate = v_even_common[0][1]
    
print(len(v_odd) - v_odd_common_candidate + len(v_even) - v_even_common_candidate)

### FIXED CODE ###

from collections import Counter
 
n = int(input())
v_array = list(map(int,input().split()))
 
v_odd = v_array[0::2]
v_even = v_array[1::2]
 
v_odd_common = Counter(v_odd).most_common()
v_even_common = Counter(v_even).most_common()

v_odd_common.append((0,0))
v_even_common.append((0,0))

if v_odd_common[0] != v_even_common[0]:
    print(n-v_odd_common[0][1]-v_even_common[0][1])
else:
    print(min(n-v_odd_common[0][1]-v_even_common[1][1],n-v_odd_common[1][1]-v_even_common[0][1]))
N = input()
X = input()
T = input()

wari = int( N / X )

if N % X == 0:
  print (wari)
  else
  wari = wari + 1
  print (wari)

### FIXED CODE ###

n,x,t = map(int, input().split())
w = n//x
if (n % x) == 0:
    print(w * t)
else:
    w += 1
    print(w * t)
def main(S=None):
    if not S:
        S = input()
    r = [0]*2019
    r[0] = 1
    tmp = 0
    base = 1
    for s in S[::-1]:
        s = int(s) * base
        base *= 10
        # base %= 2019
        tmp += s
        # tmp %= 2019
        r[tmp] += 1
    count = 0
    for v in r:
        count += v*(v-1)//2
    print(count)
    return count


if __name__ == "__main__":
    # assert main("1817181712114") == 3
    # assert main("14282668646") == 2
    # assert main("2119") == 0
    main()


### FIXED CODE ###

def main(S=None):
    if not S:
        S = input()
    r = [0]*2019
    r[0] = 1
    tmp = 0
    base = 1
    for s in S[::-1]:
        s = int(s) * base
        base *= 10
        base %= 2019
        tmp += s
        tmp %= 2019
        r[tmp] += 1
    count = 0
    for v in r:
        count += v*(v-1)//2
    print(count)
    return count


if __name__ == "__main__":
    # assert main("1817181712114") == 3
    # assert main("14282668646") == 2
    # assert main("2119") == 0
    main()
print(f'ABC' + input())

### FIXED CODE ###

print('ABC' + input())
ddef 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)]
"""
from collections import defaultdict, deque
from sys import exit
import heapq
import math
import copy
from bisect import bisect_left, bisect_right
"""
import sys
# sys.setrecursionlimit(1000000000)

N = getN()
A = getList()
listnum = [0] * 15
for i in A:
    listnum[i] += 1
for i in range(15):
    if listnum[i] >= 3:
        listnum[i] = (listnum[i] % 2) + 1
minus = listnum.count(2)
if minus % 2 == 0:
    print(sum(listnum) - minus)
else:
    print(sum(listnum) - minus - 1)

### 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)]

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import copy
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)

N = getN()
nums = [int(e) for e in input().split()]
nums.sort()
checker = nums[0]
count = 1
for i in range(1,N):
    if(checker != nums[i]):
        count+=1
        checker = nums[i]
if(N - count)%2==0:
    print(count)
else:
    print(count-1)
L, R = map(int, input().split())
mod = 2019
ans = 10**9 + 7
for i in range(L, min(L + mod, R)):
  for j in range(i + 1, min(i + mod, R)):
    ans = min((i * J) % mod, ans)
print(ans)

### FIXED CODE ###

L, R = map(int, input().split())
min_mod = 10**9
for i in range(L, min(L + 2019, R + 1)):
    for j in range(i + 1, min(L + 2019, R + 1)):
        min_mod = min(min_mod, (i * j) % 2019)
print(min_mod)
a, b = list(map(int(), input()))
print(a+b if b%a == 0 else b-a)

### FIXED CODE ###

a, b = list(map(int, input().split()))
print(a+b if b%a == 0 else b-a)
print(sorted(set([chr(i) for i in range(97, 97+26)]) - set(list(input())))[0])

### FIXED CODE ###

a = sorted(set([chr(i) for i in range(97, 97+26)]) - set(list(input())))
print(a[0] if a != [] else None)