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

d = {i+1: j for (i,j) in enumerate(a)}

sum = 0
for x in range(n):
    if( x == d[d[x]]):
        sum += 1

print sum//2

### FIXED CODE ###

n = int(input())
a = map(int, input().split())
 
d = {i+1: j for (i,j) in enumerate(a)}
 
sum = 0
for x in range(n):
    if( x+1 == d[d[x+1]]):
        sum += 1
 
print(sum//2)
from collections import defaultdict

N = int(input())
D = list(map(int, input().split()))
kind = defaultdict(int)
for d in D:
  kind[d] += 1

M = int(input())
T = list(map(int, input().split()))
for t in T:
  d[t] -= 1
  if d[t] < 0:
    print('NO')
    quit()

print('YES')

### FIXED CODE ###

from collections import defaultdict

N = int(input())
D = list(map(int, input().split()))
kind = defaultdict(int)
for d in D:
  kind[d] += 1

M = int(input())
T = list(map(int, input().split()))
for t in T:
  kind[t] -= 1
  if kind[t] < 0:
    print('NO')
    quit()

print('YES')
import sys

N, Y = list(map(int, input().split()))
for i_yukichi in range(N + 1):
    for j_higuchi in range(N + 1 - i_yukichi):
        k_noguchi = N - i_yukichi - j_higuchi
        if 10000 * i_yukichi + 5000 * j_higuchi + 1000 * k_noguchi == Y:
            print(i_yukichi, j_higuchi, k_noguchi)
            sys.exit()

print("-1 -1 -1")


### FIXED CODE ###

S = input()
for i in range(len(S)):
    if i == 3:
        print("8", end="")
    else:
        print(S[i], end="")
N , X = (int(a) for a in input().split())
L = list(map(int,input().split()))
length = 0
bound = 0
i = 0
while length <= X :
    length += L[i]
    bound += 1
    i += 1

print(bound)




### FIXED CODE ###

N , X = (int(a) for a in input().split())
L = list(map(int,input().split()))
Length = [0]
for i in range(N) :
    Length.append(Length[i] + L[i])
    if Length[i+1] > X :
        del Length[-1]
        break
    else : continue

print(len(Length))
n = int(input())
a = list(map(int, input().split()))
s = 0
ans = 0
for i in range(len(a)):
  s += a[i]
for i in range(len(a)-1):
  s -= a[i]
  if s<0:
	s += 1e9+7
  ans += s*a[i]
  ans %= 1e9+7
print(int(ans))


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
s = 0
ans = 0
for i in range(len(a)):
  s += a[i]
for i in range(len(a)-1):
  s -= a[i]
  ans += s*a[i]
  ans %= 1000000007
print(ans)
K,X=map(int,input().split())
if 500*K>=X:
  print(Yes)
else:
  print(No)

### FIXED CODE ###

K,X=map(int,input().split())
if 500*K>=X:
    print('Yes')
else:
    print('No')
a="0"+input()
b="1"+input()
dp=[[0]*len(b) for i in range(len(a))]
for i in range(len(a)):
    for j in range(len(b)):
        if a[i]==b[j]:
            if i>0 and j>0:
                dp[i][j]=dp[i-1][j-1]+1
            else:
                dp[i][j]=1
        else:
            if i>0 and j>0:
                dp[i][j]=max(dp[i-1][j],dp[i][j-1])
            elif i==0 and j>0:
                dp[i][j]=dp[i][j-1]
            elif i>0 and j==0:
                dp[i][j]=dp[i-1][j]
            else:
                dp[i][j]=0

Ans=[]
def findout(i,j):
    
    if dp[i][j]==dp[i-1][j-1]+1 and a[i]==b[j]:
        
        return (i-1,j-1)
    temp1=None
    temp2=None
    if i>0:
        temp1=findout(i-1,j)
    if j>0:
        temp2=findout(i,j-1)
    if temp1:
        return temp1
    if temp2:
        return temp2
x,y=len(a)-1,len(b)-1
ans=""
for i in range(dp[-1][-1]):
    x,y=findout(x,y)
    ans+=a[x+1]
print(ans[::-1])                

### FIXED CODE ###

a="0"+input()
b="1"+input()
dp=[[0]*len(b) for i in range(len(a))]
for i in range(len(a)):
    for j in range(len(b)):
        if a[i]==b[j]:
            if i>0 and j>0:
                dp[i][j]=dp[i-1][j-1]+1
            else:
                dp[i][j]=1
        else:
            if i>0 and j>0:
                dp[i][j]=max(dp[i-1][j],dp[i][j-1])
            elif i==0 and j>0:
                dp[i][j]=dp[i][j-1]
            elif i>0 and j==0:
                dp[i][j]=dp[i-1][j]
            else:
                dp[i][j]=0

ans = []
x,y=len(a)-1,len(b)-1
lcs = dp[x][y]
while x > 0 or y > 0:
    if x-1 >= 0 and dp[x-1][y] == lcs:
        x -= 1
    elif y-1 >= 0 and dp[x][y-1] == lcs:
        y -= 1
    else:
        ans.append(a[x])
        y -= 1
        x -= 1
        
        lcs -= 1
print("".join(ans[::-1]))
s = input()
t = input()
 
count = 0
 
for i in range(len(s))
if s[i] != t[i]:
  count += 1

print(count)

### FIXED CODE ###

s = input()
t = input()
 
count = 0
 
for i in range(len(s)):
	if s[i] != t[i]:
		count += 1
print(count)
N,K=map(int, input().split()) 
R,S,P=map(int, input().split()) 
T=input()
SC=0

def MaxScore(n,t):
    SC = 0
    if t[0]=='r':
        SC+=P
    elif t[0]=='s':
        SC+=R
    else:
        SC+=S
    NC=1
    for i in range(1,n):
        if t[i]=='r':
            if t[i]!=t[i-1]:
                SC+=P
                NC=1
            elif t[i]==t[i-1] and NC%2==0:
                SC+=P
                NC+=1
            else:
                NC+=1
        elif t[i]=='s':
            if t[i]!=t[i-1]:
                SC+=R
                NC=1
            elif t[i]==t[i-1] and NC%2==0:
                SC+=R
                NC+=1
            else:
                NC+=1
        else:
            if t[i]!=t[i-1]:
                SC+=S
                NC=1
            elif t[i]==t[i-1] and NC%2==0:
                SC+=S
                NC+=1
            else:
                NC+=1
    return SC

for i in range(K):
    Ti=[T[j] for j in range(N) if j%K==i]
    Ti=''.join(Ti)
    if (N-i)%K==0:
        Ni=(N-i)//K
    else:
        Ni=(N-i)//K+1
    SCi=MaxScore(Ni,Ti)
    SC+=SCi
    
print(SC)         

### FIXED CODE ###

s, t = input().split()
print(t+s)
h,w = map(int, input().split())
sl = []
for _ in range(h):
    row = list(input())
    sl.append(row)


dp = [ [10000]*w for _ in range(h) ]
dp[0][0] = 0

for wi in range(w):
    for hi in range(h):
        if wi+1 < w:
            if sl[wi][hi] == '.' and sl[wi+1][hi] == '#':
                dp[wi+1][hi] = min( dp[wi+1][hi], dp[wi][hi]+1 )
            else:
                dp[wi+1][hi] = min( dp[wi+1][hi], dp[wi][hi] )

        if hi+1 < h:
            if sl[wi][hi] == '.' and sl[wi][hi+1] == '#':
                dp[wi][hi+1] = min( dp[wi][hi+1], dp[wi][hi]+1 )
            else:
                dp[wi][hi+1] = min( dp[wi][hi+1], dp[wi][hi] )


ans = dp[w-1][h-1]
if sl[0][0] == '#': ans += 1
print(ans)


### FIXED CODE ###

h,w = map(int, input().split())
sl = []
for _ in range(h):
    row = list(input())
    sl.append(row)


dp = [ [10000]*w for _ in range(h) ]
dp[0][0] = 0

for h_i in range(h):
    for w_i in range(w):
        if h_i+1 < h:
            if sl[h_i][w_i] == '.' and sl[h_i+1][w_i] == '#':
                dp[h_i+1][w_i] = min( dp[h_i+1][w_i], dp[h_i][w_i]+1 )
            else:
                dp[h_i+1][w_i] = min( dp[h_i+1][w_i], dp[h_i][w_i] )

        if w_i+1 < w:
            if sl[h_i][w_i] == '.' and sl[h_i][w_i+1] == '#':
                dp[h_i][w_i+1] = min( dp[h_i][w_i+1], dp[h_i][w_i]+1 )
            else:
                dp[h_i][w_i+1] = min( dp[h_i][w_i+1], dp[h_i][w_i] )


ans = dp[h-1][w-1]
if sl[0][0] == '#': ans += 1
print(ans)
# -*- coding: utf-8 -*-
s = int(input())

a = [s]
for i in range(10):
    #print(i)
    if a[i] % 2 == 0:
        a.append(a[i] // 2)
    else:
        a.append(3 * a[i] + 1)
#print(a)
i = 0
flag = True
while flag:
    for j in range(i):
        if a[i] == a[j]:
            ans = i + 1
            flag = False
            break
    i += 1
print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
s = int(input())

a = [s]
for i in range(1000001):
    #print(i)
    if a[i] % 2 == 0:
        a.append(a[i] // 2)
    else:
        a.append(3 * a[i] + 1)
#print(a)
i = 0
flag = True
while flag:
    for j in range(i):
        if a[i] == a[j]:
            ans = i + 1
            flag = False
            break
    i += 1
print(ans)
import numpy as np
N,M =map(int,input().split())
h_lis=np.array(list(map(int,input().split())))
way_lis=[list(map(int,input().split())) for _ in range(M)]

tes=0
for i in range(N):
    nears=[]
    for way in way_lis:
        if i+1 in way:
            nears.extend(way)
    for j,ne in enumerate(nears):
        if j==0:
            h=max(h_lis[ne[0]-1],h_lis[ne[1]-1])
            z=h
        else:
            k=z
            h=max(h_lis[ne[0]-1],h_lis[ne[1]-1])
            z=max(k,h)
    if z==h_lis[i]:
        tes+=1
print(tes)

### FIXED CODE ###

S=input()
if S=="ABC":
  print("ARC")
else:
  print("ABC")
import sys
from itertools import combinations
import math


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())


N = I()
prev_t = 0
prev_x = 0
prev_y = 0
for i in range(N):
    t, x, y = LI()
    if (x+y) > (t - prev_t) or (abs(prev_x-x) + abs(prev_y-y) + (t - prev_t)) % 2:
        print('No')
        exac()
    prev_t = t
    prev_x = x
    prev_y = y
print('Yes')


### FIXED CODE ###

import sys
from itertools import combinations
import math


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())


N = I()
prev_t = 0
prev_x = 0
prev_y = 0
for i in range(N):
    t, x, y = LI()
    if abs(prev_x-x) + abs(prev_y-y) > (t - prev_t) or (abs(prev_x-x) + abs(prev_y-y) + (t - prev_t)) % 2:
        print('No')
        exit()
    prev_t = t
    prev_x = x
    prev_y = y
print('Yes')
n=int(input())
a=list(map(int,input().split()))
a.append(0)
x=a[0]
xi=1
ans=0
x_s=0
x_e=0
a_sum=a[0]
while x_e<n:
    if x_s==x_e:
        x_e+=1
        ans+=1
        xi=2
        x^=a[x_e]
        a_sum+=a[x_e]
    elif x==a_sum:
        ans+=xi
        xi+=1
        x_e+=1
        x=x^a[x_e]
        a_sum=a_sum+a[x_e]
    else:
        xi-=1
        x=x^a[x_s]
        a_sum=a_sum-a[x_a]
        x_s+=1

print(ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a.append(0)
x=a[0]
xi=1
ans=0
x_s=0
x_e=0
a_sum=a[0]
while x_e<n:
    if x_s==x_e:
        x_e+=1
        ans+=1
        xi=2
        x^=a[x_e]
        a_sum+=a[x_e]
    elif x==a_sum:
        ans+=xi
        xi+=1
        x_e+=1
        x=x^a[x_e]
        a_sum=a_sum+a[x_e]
    else:
        xi-=1
        x=x^a[x_s]
        a_sum=a_sum-a[x_s]
        x_s+=1

print(ans)
W, H, x, y = map(int, input().split())

def calculate(W, H, x, y):
	total_area = W*H
	way = 0
	if(x==W/2 or y==H/2):
		area = total_area/2
	if(x==W/2 and y==H/2):
		way = 1
	return area, way

area, way = calculate(W, H, x, y)

print("%f %d" % (area, way))

### FIXED CODE ###

W, H, x, y = map(int, input().split())

def calculate(W, H, x, y):
	way = 0
	area = W*H/2.0
	if(x==W/2 and y==H/2):
		way = 1
	return area, way

area, way = calculate(W, H, x, y)

print("%f %d" % (area, way))
import collections


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


N = int(input())

primes = prime_factorize(N)


num = 0
hist = []
c = primes[0]
for p in primes:
    if c not in hist:
        hist.append(c)
        num += 1
        c = 1
    c *= p

print(num)


### FIXED CODE ###

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


N = int(input())

primes = prime_factorize(N)

num = 0
hist = [1]
c = 1

tmp = 1
for p in primes:
    # 前回と異なる場合
    if tmp != p:
        c = 1
    tmp = p
    c *= p
    if c not in hist:
        hist.append(c)
        num += 1
        c = 1
print(num)
N = int(input())
a = list(map(int, input().split()))
brick = []
number = 1

for i in range(N):
  if a[i] == number:
    brick.append(number)
    number += 1
print(N - max(brick))

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
brick = [0]
number = 1

import sys

if min(a) > 1:
  print('-1')
  sys.exit()

for i in range(N):
  if a[i] == number:
    brick.append(number)
    number += 1
print(N - max(brick))
s=input()
list0=[000]
list1=[100,010,001]
list2=[110,101,011]
list3=[111]
if s in list0:
    print(0)
if s in list1:
    print(1)
if s in list2:
    print(2)
if s in list3:
    print(3)

### FIXED CODE ###


s=input()
list0=["000"]
list1=["100","010","001"]
list2=["110","101","011"]
list3=["111"]
if s in list0:
    print(0)
if s in list1:
    print(1)
if s in list2:
    print(2)
if s in list3:
    print(3)
n = int(input())
s = list(map(int, input().split(" ")))
# n = 18
# s = list(reversed(range(1, 262145)))

s = sorted(s, reverse=True)
from collections import deque

# def merge(x, y):

#     i = 0
#     j = 0

#     new = []
#     k = 0
#     l = 0
#     while k < len(x):
#         if x[k] > y[l]:
#             k += 1
#             l += 1
#         else:
#             print("No")
#             exit(0)

#         if x[i] > y[j]:
#             new.append(x[i])
#             i += 1
#         else:
#             new.append(y[j])
#             j += 1

#     new.extend(x[i:])
#     new.extend(y[j:])
#     return new

def solve():
    Q = deque()
    Q.appendleft((s[0], 0))
    s.pop(0)
    while s:
        x, j = Q.pop()
        for i in range(j, n):
            if x > s[0]:
                Q.appendleft((s[0], j + 1))
                s.pop(0)
            else:
                print("No")
                exit(0)
    print("Yes")
solve()
# slimes = [s[0]]
# s = s[1:]
# for i in range(n):
#     newslimes = []
#     m = len(slimes)
#     slimes = merge(slimes, s[:m])
#     print(slimes)
#     s = s[m:]
#     # print(len(slimes), len(s))

# print("Yes")


### FIXED CODE ###

import bisect

n = int(input())
s = list(map(int, input().split(" ")))
# n = 18
# s = list(reversed(range(1, 2 ** n + 1)))

s = sorted(s)
from collections import deque

def solve():
    global s

    parents = [s[-1]]
    s.pop()

    for i in range(n):
        newparents = list(parents)
        k = len(s)
        dropped = set()
        # print(parents)
        for p in parents:
            oldK = k
            k = bisect.bisect(s, p - 1, 0, k) - 1
            # print("Old", oldK, k, s[k], p)
            if k == -1:
                print("No")
                exit(0)

            newparents.append(s[k])
            dropped.add(k)
        s = [x for i, x in enumerate(s) if i not in dropped]
        parents = sorted(newparents, reverse=True)

    # print(parents)
    # print(k)
    if k == len(s):
        print("Yes")
    else:
        print("No")
solve()
def intinput(): return map(int,input().split())

def ab(i):
    global c,l,x
    while len(l[i])>0:
        x[l[i][0]]=c.pop(0)
        l[l[i][0]].remove(i)
        ab(l[i][0])
        l[i].pop(0)

    return

n=int(input())
l = [[] for _ in range(n+1)]
for i in range(n-1):
    a,b=intinput()
    l[a].append(b)
    l[b].append(a)
c = list(intinput())
c += [0,0,0,0,0,0,0]
c.sort(reverse=1)
x = [0 for _ in range(n+1)]
x[1]=c.pop(0)
for i in range(1,n+1):
    ab(i)
print(sum(x[2:]))
f = ""
q= len(x[1:])
for i in range(q):
    if i != q-1:
        f += str(x[i+1])+" "
    else:
        f += str(x[i+1])
print(f)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000) 

def intinput(): return map(int,input().split())

def ab(i):
    global c,l,x
    while len(l[i])>0:
        x[l[i][0]] = c.pop(0)
        l[l[i][0]].remove(i)
        ab(l[i][0])
        l[i].pop(0)
    return

n=int(input())
l = [[] for _ in range(n+1)]
for i in range(n-1):
    a,b=intinput()
    l[a].append(b)
    l[b].append(a)
c = list(intinput())
c.sort(reverse=1)
x = [0 for _ in range(n+1)]
x[1]=c.pop(0)
for i in range(1,n+1):
    ab(i)
print(sum(x[2:]))
f = ""
q= len(x[1:])
for i in range(q):
    if i != q-1:
        f += str(x[i+1])+" "
    else:
        f += str(x[i+1])
print(f)
N = int(input())
h = list(map(int, input().split()))

cost = [0, abs(h[1]-h[0])]
def dp(i):
  if i >= len(cost):
    cost.append(min(dp(i-1)+abs(h[i]-h[i-1]), dp(i-2)+abs(h[i]-h[i-2])))
  return cost[i]

print(dp(N-1))

### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

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

memo = [10**10 for _ in range(N+1)]

def dp(i):
    if i == 1:
        return 0
    elif i == 2:
        memo[i] = abs(h[i-2]-h[i-1])
        return memo[i]
    elif memo[i] < 10**10:
        return memo[i]
    else:
        memo[i] = min(
            dp(i-1) + abs(h[i-2]-h[i-1]),
            dp(i-2) + abs(h[i-3]-h[i-1]),
            dp(i-2) + abs(h[i-3]-h[i-2]) + abs(h[i-2]-h[i-1])
        )
        return memo[i]
print(dp(N))
def judge(S):
    if S == "SUN":
        print(7)
    if S == "MON"
        print(6)
    if S == "TUE":
        print(5)
    if S == "WED"
        print(4)
    if S == "THU":
        print(3)
    if S == "FRI"
        print(2)
    if S == "SAT":
        print(1)

S = input()
judge(S)

### FIXED CODE ###

def judge(S):
    if S == "SUN":
        print(7)
    if S == "MON":
        print(6)
    if S == "TUE":
        print(5)
    if S == "WED":
        print(4)
    if S == "THU":
        print(3)
    if S == "FRI":
        print(2)
    if S == "SAT":
        print(1)

S = input()
judge(S)
import sys
sys.setrecursionlimit(1000000)

N,M = map(int,input().split())
ma = list(map(int,input().split()))
n = len(a)
ma_map = [ -1, 2, 5, 5, 4, 5, 6, 3, 7, 6 ]
memo = [-1] * 100000

def dp(num):
	if memo[num] != -1: return memo[num]
	if num == 0: return 0

	ret = -1
	for p in ma:
		if 0 <= num - ma_map[p]:
			ret = max(dp(num - ma_map[p]) * 10 + p, ret)

	memo[num] = ret
	return ret

ma.sort()
print(dp(N))


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
 
ma_map = [ -1, 2, 5, 5, 4, 5, 6, 3, 7, 6 ]
N, M = (int(i) for i in input().split())
ma = list(int(i) for i in input().split())
memo = [-1] * 100000
 
def dfs(num):
	if memo[num] != -1: return memo[num]
	if num == 0: return 0
 
	ret = -1
	for p in ma:
		if 0 <= num - ma_map[p]:
			ret = max(dfs(num - ma_map[p]) * 10 + p, ret)
 
	memo[num] = ret
	return ret
 
ma.sort()
print(dfs(N))
n, m = map(int, input().split())
ans1 = 0
ans2 = 0
preans2 = 0
check = 0
t = []
pret = []

for i in range(m):
  pret = list(map(str, input().split()))
  t.append(pret)
  
for i in range(m):
  if t[i][1] == "WA":
    if check = 0:
      preans2 += 1
  else:
    if check = 0:
      ans1 += 1
      ans2 += preans2
      preans2 = 0
      check += 1
    else:
      ans1 += 1
      check += 1
  if i > 0:
    if t[i][0] != t[i-1][0]:
      check = 0
      
print(ans1, ans2)

### FIXED CODE ###

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

ac = 0
wa = 0
dwa = {}
d = {}

for i in range(m):
  p, s = input().split()
  if d.get(p) == "AC":
    continue
  if p not in dwa:
    dwa[p] = 0
  if s == "WA":
    dwa[p] += 1
  else:
    ac += 1
    wa += dwa[p]
  d[p] = s
  
print(ac, wa)
s = input()
l = len(s)
mod = [1] + [0 for _ in range(2017)]
ml = [0 for _ in range(l + 1)]
ans = 0

tmp = 0
for idx, degit in enumerate(s[::-1]):
    m = (int(degit) * (10 ** idx) + tmp) % 2019
    tmp = m
    ans += mod[m]
    mod[m] += 1

print(ans)


### FIXED CODE ###

s = input()
l = len(s)
mod = [1] + [0 for _ in range(2019)]
ml = [0 for _ in range(l + 1)]
ans = 0

tmp = 0
for idx, degit in enumerate(s[::-1]):
    m = int(degit) * pow(10, idx, 2019)
    m = (m + tmp) % 2019
    tmp = m
    ans += mod[m]
    mod[m] += 1

print(ans)
N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]

ans = 0
for i in a:
  ans = max(ans, s.count(i) - t.count(i))

print(ans)

### FIXED CODE ###

from collections import Counter

N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]
a = Counter(s)
a = a.most_common()


ans = 0
for i in a:
  if i[0] not in t:
    ans = max(i[1],ans)

  elif i[0] in t:
    ans = max(i[1] - t.count(i[0]),ans)


print(ans)
N=input()
nlist= [int(l) for l in raw_input().split(' ')]

rate= [0,0,0,0,0,0,0]
max = 0
for n in nlist:
	if n/400>=8:
		max += 1
	else:
		rate[n/400]=1

print(sum(rate)),
if sum(rate)+max > 8:
	print(8)
else:
	print(sum(rate)+max)

### FIXED CODE ###

N=input()
nlist= [int(l) for l in raw_input().split(' ')]

rate= [0,0,0,0,0,0,0,0]
up = 0
for n in nlist:
	if n/400>=8:
		up += 1
	else:
		rate[n/400]=1

print max(1,sum(rate)),sum(rate)+up
S = list(str(input()))
if (S[0]==S[1]) and (S[0]==S[2]) and (S[0]==S[3]):
    print('No')
elif (S[0]==S[1]) and (S[2]==S[3]):
    print('Yes')
elif (S[0]==S[2]) and (S[1]==S[3]):
    print('Yes')
elif (S[0]==S[3]) and (S[1]==S[2]):
    print('Yes')
else:

### FIXED CODE ###

S = list(str(input()))
if (S[0]==S[1]) and (S[0]==S[2]) and (S[0]==S[3]):
    print('No')
elif (S[0]==S[1]) and (S[2]==S[3]):
    print('Yes')
elif (S[0]==S[2]) and (S[1]==S[3]):
    print('Yes')
elif (S[0]==S[3]) and (S[1]==S[2]):
    print('Yes')
else:
    print('No')
import cmath
import math
import itertools
n=int(input())
a=[]
b=[]
#偏角ソートの方が楽
for i in range(n):
    x,y=map(int,input().split())
    a.append(complex(x,y))
    b.append(cmath.phase(a[i]))
#a.sort(key=cmath.phase)
m=0
#math.piに注意
for i in range(n):
    if a[i]!=complex(0,0):
        za,zb=complex(0,0),complex(0,0)
        for j in range(n):
            p=cmath.phase(a[j]/a[i])
            if -math.pi<=p<=0:
                za+=a[j]
            if 0<=p<=math.pi:
                zb+=a[j]
        m=max([m,abs(za),abs(zb)])
        if i!=n-1:
            zc,zd=complex(0,0),complex(0,0)
            for j in range(n):
                p=cmath.phase(a[j]/((a[i]+a[i+1])/2))
                if -math.pi<=p<=0:
                    zc+=a[j]
                if 0<=p<=math.pi:
                    zd+=a[j]
            m=max([m,abs(zc),abs(zd)])

print(m)


### FIXED CODE ###

import cmath
import math
n=int(input())
a=[]
b=[]
#偏角ソートの方が楽
for i in range(n):
    x,y=map(int,input().split())
    a.append(complex(x,y))
    b.append(cmath.phase(a[i]))
#a.sort(key=cmath.phase)
ma=0
#math.piに注意
for i in range(n):
    z=a[i]
    c=b[i]-math.pi/2
    d=b[i]+math.pi/2
    l=max([c,-math.pi])
    r=min([d,math.pi])
    #(0,0)の時は偏角が0になってしまうし、除く
    #あとは-piとpiどっちになるか→piになる
    if a[i]!=complex(0,0):
        for j in range(n):
            if j!=i:
                #境界条件の場合分けがむずい
                if l<=b[j]<=r or (c<=-math.pi and c+2*math.pi<=b[j]<=math.pi) or (d>=math.pi and -math.pi<=b[j]<=d-2*math.pi):
                    z+=a[j]
    ma=max([abs(z),ma])
m=0
#math.piに注意
for i in range(n):
    if a[i]!=complex(0,0):
        za,zb=complex(0,0),complex(0,0)
        for j in range(n):
            p=cmath.phase(a[j]/a[i])
            if -math.pi<=p<=0:
                za+=a[j]
            if 0<=p<=math.pi:
                zb+=a[j]
        m=max([m,abs(za),abs(zb)])
        if i!=n-1 and a[i]+a[i+1]!=0:
            zc,zd=complex(0,0),complex(0,0)
            for j in range(n):
                p=cmath.phase(a[j]/((a[i]+a[i+1])/2))
                if -math.pi<=p<=0:
                    zc+=a[j]
                if 0<=p<=math.pi:
                    zd+=a[j]
            m=max([m,abs(zc),abs(zd)])

print(max([m,ma]))
x,y,z = map(input().split())
print(z,x,y)

### FIXED CODE ###

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