Harryxun/stf_run huggingface dataset:
import numpy as np

def main():
  N = int(input())
  A = list(map(int,input().split()))
  A.sort()
  d = np.zeros(A[-1]+1, dtype=np.unit64)
  
  for i in range(N):
    a = A[i]
    a1 = A[i-1]
    if a != a1:
      d[a::a] += 1
    else:
      d[a] += 1
  print(np.count_nonzero(d[A] == 1))
  
print(main())


### FIXED CODE ###

import numpy as np

def main():
  N = int(input())
  A = list(map(int,input().split()))
  A.sort()
  d = np.zeros(A[-1]+1, dtype=np.uint64)
  
  for i in range(N):
    a = A[i]
    a1 = A[i-1]
    if a != a1:
      d[a::a] += 1
    else:
      d[a] += 1
  print(np.count_nonzero(d[A] == 1))
  
main()
import numpy as np
from numpy.linalg import matrix_power
H,W,K=map(int,input().split())
def c(i,j):
    f=[1,1,2,3,5,8,13,21]
    a=0
    if i==j+1: a=f[j]*f[W-i-1]
    if j in (i,i+1): a=f[i]*f[W-j-1]
    return(a)
def mp(m,n,p):
    a = m%p
    if n==0:
        return(np.identity(m.diagonal().size,dtype='int32'))
    if n==1:
        return(a)
    else:
        q,r=divmod(n,2)
        x=np.matmul(a,a)%p
        if r==1:
            return(np.matmul(a,mp(x,q,p))%p)
        else:
            return(mp(x,q,p)%p)

m=mp(np.array([[c(i,j) for i in range(W)] for j in range(W)]),H,1000000007)
x=np.array([[c(i,j) for i in range(W)] for j in range(W)])
print(m[0,K-1])

          

### FIXED CODE ###

MOD = 1000000007
H,W,K=map(int,input().split())
##Precalculation            
num = [[0 for _ in range(W)] for _ in range(W)]
for value in range(2**(W-1)):
    bit = [False for _ in range(W-1)]
    for d in range(W-1):
        bit[d] = (2**d & value) > 0
    duplicate = False
    for d in range(1,W-1):
        if bit[d] and bit[d-1]:
            duplicate = True
            break
    if duplicate:
        continue
    ##No Duplicate Assured
    for x in range(W):
        num[x][x] += 1
    for d in range(W-1):
        if bit[d]:
            num[d][d+1] += 1
            num[d+1][d] += 1
            num[d][d] -= 1
            num[d+1][d+1] -= 1
##Time to Dynamic Programming YEAHHHHHH##
dp = [[0 for _ in range(W)] for _ in range(H+1)]
dp[0][0] = 1
for h in range(1,H+1):
    for k in range(W):
        for j in range(W):
            dp[h][k] += (dp[h-1][j]*num[j][k])%MOD
            dp[h][k] %= MOD
print(dp[H][K-1])
N = int(input())
A = list(map(int, input().split()))

import math
from itertools import permutations

lis = [0]*N
for i in range(N):
    lis[i] = i

num = math.factorial(N)

scores = [0] * num
for i, v in enumerate(permutations(lis, N)):
    score = 0
    for j in range(N):
        score += abs(v.index(j)-j) * A[j]
    scores[i] = score

print(max(scores))

### FIXED CODE ###

def solve(N, A):
    a = [(i, ai) for i, ai in enumerate(A)]
    a.sort(key=lambda x: x[1], reverse=True)

    # import numpy as np
    # dp = np.zeros((N+1, N+1), np.int8)

    dp = [[0] * (N + 1) for _ in range(N + 1)]

    dp[0][0] = 0
    for i, ai in enumerate(a):
        for l in range(i+1):
            r = i - l
            dp[i+1][l] = max(dp[i+1][l], dp[i][l] + ai[1] * ((N-1-r) - ai[0]))
            dp[i+1][l+1] = max(dp[i+1][l+1], dp[i][l] + ai[1] * (ai[0] - l))

    print(max(dp[N]))

N = int(input())
A = list(map(int, input().split()))
solve(N,A)
x = list(map(int, input.split()))
print(15 - sum(x))

### FIXED CODE ###

x = list(map(int, input().split()))
print(x.index(0)+1)
from sys import exit

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


def gcd(a, b):
    if a == 0:
        return b

    if b == 0:
        return a

    temp = a % b
    while temp != 0:
        a = b
        b = temp
        temp = a % b

    return b


# 0 ~ i
def left(i):
    if i == 0:
        return 0

    return gcd(left(i - 1), A[i - 1])


# i ~ N-1
def right(i):
    if i == N - 1:
        return 0

    return gcd(right(i + 1), A[i + 1])


ans = []

for i in range(N):
    ans.append(gcd(left(i), right(i)))

print(max(ans))


### FIXED CODE ###

from sys import exit

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


def gcd(a, b):
    if a == 0:
        return b

    if b == 0:
        return a

    temp = a % b
    while temp != 0:
        a = b
        b = temp
        temp = a % b

    return b


left = [0 for i in range(N)]
right = left[:]

for i in range(1, N):
    left[i] = gcd(A[i - 1], left[i - 1])
    right[-i - 1] = gcd(A[-i], right[-i])

ans = [gcd(left[i], right[i]) for i in range(N)]

print(max(ans))
n, m = map(int,input().split())

boolins =[]
for i in range(n):
    boolins.append(0)
    
for i in range(m):
    xxx = list(map(int,input().split()))
    if xxx[0] == 1:
        boolins[xxx[1]] = boolins[xxx[1]] + 1
    elif xxx[1] == n :
        boolins[xxx[0]] boolins[xxx[0]]+ 1
    else
        None


if 2 in boolins:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

### FIXED CODE ###

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

boolins =[]
for i in range(n):
    boolins.append(0)
    
for i in range(m):
    xxx = list(map(int,input().split()))
    if xxx[0] == 1:
        boolins[xxx[1]] = boolins[xxx[1]] + 1
    elif xxx[1] == n :
        boolins[xxx[0]]=boolins[xxx[0]]+ 1
    else:
        None


if 2 in boolins:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
N = int(input())
A = list(map(int, input().split()))

hats = A[:]
d = {}
for h in hats:
    d[h] = True

h1 = hats[0]
 
def search(now1, now2, count):
    now1, now2 = now2, now1^now2
    if now2 in d:
        if now2 == h1:
            if count == N:
                return True
            if count > N:
                return False
            else:
                return search(now1, now2, count+1)
        else:
            return search(now1, now2, count+1)
    else:
        return False
    

ans = False
for h2 in hats[1:]:
    if search(h1, h2, 2):
        ans = True

if ans:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

hats = A[:]
import copy
from collections import defaultdict
d = defaultdict(lambda: 0)

for h in hats:
    d[h] += 1

def f():
    if len(d) == 3:
        xor = 0
        for key in d:
            xor ^= key
        if xor == 0:
            lsit_d = list(d.keys())
            if d[lsit_d [0]] == d[lsit_d [1]] and d[lsit_d [0]] == d[lsit_d [2]]:
                return 'Yes'
            else:
                return 'No'
        else:
            return 'No'

    if len(d) == 1:
        lsit_d = list(d.keys())
        if lsit_d [0] == 0:
            return 'Yes'
        
    if len(d) == 2:
        if d[0] * 2 == N - d[0]:
            return 'Yes'
    
    return 'No'
    
print(f())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


a,b,c,d = map(int,input().split())
c_i=a//c
d_i=a//d
cd_i=a//(lcm(c,d))
if not a%c==0:
    c_i+=1
if not a%d==0:
    d_i+=1
if not a%(lcm(c,d))==0:
    cd_i+=1

c_f=b//c
d_f=b//d
cd_f=b//(lcm(c,d))

print(b-a-(c_f+d_f-cd_f-c_i-d_i+cd_i+1)+1)


### FIXED CODE ###

def gcd(m,n):
    x= max(m,n)
    y= min(m,n)
    if x%y == 0:
        return y
    else:
        while not x%y==0:
            z=x%y
            x= y
            y=z
        else:
            return z
def lcm(x, y):
    return (x * y) // gcd(x, y)


a,b,c,d = map(int,input().split())
lcm = lcm(c,d)
c_i=a//c
d_i=a//d
cd_i=a//lcm
if not a%c==0:
    c_i+=1
if not a%d==0:
    d_i+=1
if not a%lcm==0:
    cd_i+=1

c_f=b//c
d_f=b//d
cd_f=b//lcm

print(b-a-(c_f+d_f-cd_f-c_i-d_i+cd_i+1)+1)
import fractions as frac
a, b, c, d, e, f = map(int, input().split())
memo=[[(-1, -1)]*10000 for i in range(1000)]
func = lambda t: frac.Fraction(t[0], t[1]  ) 
def dp(s, w):
    if w*e<s or w*100+s>f:
        return (-1, -1)
    m=memo[s][w]
    if m[0]>0:
        return memo[s][w]
    p0=(s,w) 
    p1=dp(s, w+a)
    p2=dp(s, w+b)
    p3=dp(s+c, w)
    p4=dp(s+d, w)
    memo[s][w]=max(p0, p1, p2, p3, p4, key = func) if w>0 else max(p1, p2, key = func)
    return memo[s][w]
    
ans=dp(0,0)
print(ans[0]+ans[1]*100, ans[0])


### FIXED CODE ###

import fractions as frac
a, b, c, d, e, f = map(int, input().split())
memo=[[(-1, -1)]*1000 for i in range(10000)]
func = lambda t: frac.Fraction(t[0], t[1]) if t[1]>0 else -10
def dp(s, w):
    if w*e<s or w*100+s>f:
        return (-1, -1)
    m=memo[s][w]
    if m[0]>0:
        return m
    p0=(s,w) 
    p1=dp(s, w+a)
    p2=dp(s, w+b)
    p3=dp(s+c, w)
    p4=dp(s+d, w)
    memo[s][w]=max(p0, p1, p2, p3, p4, key = func) if w>0 else max(p1, p2, key = func)
    return memo[s][w]
    
ans=dp(0,0)
print(ans[0]+ans[1]*100, ans[0])
def m():
    H, W = map(int, input().split())
    S = []
    for i in range(H):
        S.append(list(input()))

    graph = [[[]for _ in range(W)] for _ in range(H)]
    visited = []
    for i in range(H):
        for j in range(W):
            if S[i][j] == ".":
                continue
            if S[max(i - 1, 0)][j] == ".":
                graph[max(i - 1, 0)][j].append((i,j))
                graph[i][j].append((max(i - 1, 0),j))

            if S[min(i+1, H-1)][j] == ".":
                graph[min(i + 1, H - 1)][j].append((i,j))
                graph[i][j].append((min(i + 1, H - 1),j))

            if S[i][max(j - 1, 0)] == ".":
                graph[i][max(j - 1, 0)].append((i,j))
                graph[i][j].append((i,max(j - 1, 0)))

            if S[i][min(j+1, W-1)] == ".":
                graph[i][min(j + 1, W - 1)].append((i,j))
                graph[i][j].append((i,min(j+1, W-1)))

    bw = [0] * 2
    def dfs(g):
        for a,b in g:
            if (a,b) in visited:
                continue
            visited.append((a,b))
            if S[a][b] == ".":
                bw[0] += 1
            else:
                bw[1] += 1
            dfs(graph[a][b])

    ans = 0
    for i in range(H):
        for j in range(W):
            bw[0], bw[1] = 0, 0
            dfs(graph[i][j])
            ans += bw[0] * bw[1]

    return ans

print(m())

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

def m():
    H, W = map(int, input().split())
    S = []
    for i in range(H):
        S.append(list(input()))

    graph = [[[]for _ in range(W)] for _ in range(H)]
    visited = [[0 for _ in range(W)] for _ in range(H)]
    for i in range(H):
        for j in range(W):
            if S[i][j] == ".":
                continue
            if S[max(i - 1, 0)][j] == ".":
                graph[max(i - 1, 0)][j].append((i,j))
                graph[i][j].append((max(i - 1, 0),j))

            if S[min(i+1, H-1)][j] == ".":
                graph[min(i + 1, H - 1)][j].append((i,j))
                graph[i][j].append((min(i + 1, H - 1),j))

            if S[i][max(j - 1, 0)] == ".":
                graph[i][max(j - 1, 0)].append((i,j))
                graph[i][j].append((i,max(j - 1, 0)))

            if S[i][min(j+1, W-1)] == ".":
                graph[i][min(j + 1, W - 1)].append((i,j))
                graph[i][j].append((i,min(j+1, W-1)))

    bw = [0] * 2
    def dfs(g):
        for a,b in g:
            if visited[a][b] == 1:
                continue
            visited[a][b] = 1
            if S[a][b] == ".":
                bw[0] += 1
            else:
                bw[1] += 1
            dfs(graph[a][b])

    ans = 0
    for i in range(H):
        for j in range(W):
            if visited[i][j] == 1:
                continue
            bw[0], bw[1] = 0, 0
            dfs(graph[i][j])
            ans += bw[0] * bw[1]

    return ans

print(m())
n = int(input())
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    if len(s) % 2:
        print(" ".join(s1[::-1]) +" "+ " ".join(s2))
    else:
        print(" ".join(s2[::-1]) +" "+ " ".join(s1))
else:
    print(" ".join(s1))

### FIXED CODE ###

x,y,z = map(int, input().split())
a = []
a.append(x)
a.append(y)
a.append(z)
a.sort()
print((a[0]+a[1]))
import collections
s = input()

l = [int(s[-1])]
d = 10
for i in range(len(s)-2, -1, -1):
  l.append((l[-1] + int(s[i])*d) % 2019)
  d *= 10
  d %= 2019
c = collections.Counter(l)
ans = 0  
for i in c.values():
  ans += i*(i-1)//2

ans += c[0]

print(ans)

### FIXED CODE ###

s, w = map(int, input().split())

if s <= w:
  print('unsafe')
else:
  print('safe')
#!/usr/bin/env python3
import sys
import numpy as np

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    # A = [[int()] * (M+1) for _ in range(N)] # type: "List[int]"
    A = np.zeros((N,M+1))
    for i in range(N):
        A[i] = [int(next(tokens)) for _ in range(M+1)]
    
    # print(A)
    # print(type(A[0]))
    # A = np.array(A)
    min_c = [10000000]

    def dfs(k, dep):
        if dep == N-1:
            if (k[1:]>=X).all():
                min_c[0] = min(min_c[0], k[0])
            elif (k[1:]+A[dep][1:]>=X).all():
                min_c[0] = min(min_c[0], k[0]+A[dep][0])
        else:
            dfs(k+A[dep],dep+1)
            dfs(k,dep+1)

    dfs(A[0], 1)          
    dfs(np.zeros(M+1), 1)
    
    if min_c[0] != 10000000:
        print(int(min_c[0]))
    else:
        print(-1)




if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import numpy as np

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    A = np.zeros((N,M+1))
    for i in range(N):
        A[i] = [int(next(tokens)) for _ in range(M+1)]
    
    min_c = [10000000]

    def dfs(k, dep):
        if dep == N-1:
            if (k[1:]>=X).all():
                min_c[0] = min(min_c[0], k[0])
            elif ((k+A[dep])[1:]>=X).all():
                min_c[0] = min(min_c[0], k[0]+A[dep][0])
        else:
            dfs(k+A[dep],dep+1)
            dfs(k,dep+1)
    
    dfs(np.zeros(M+1), 0)
    
    if min_c[0] != 10000000:
        print(int(min_c[0]))
    else:
        print(-1)




if __name__ == '__main__':
    main()
import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

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

class BIT:
	def __init__(self, N):
		self.size = N
		self.tree = [0] * (N + 1)

	def sum(self, t):
		s = 0
		while t > 0:
			s += self.tree[t]
			t -= t & -t
		return s

	def add(self, t, x):
		while t <= self.size:
			self.tree[t] += x
			t += t & -t

#処理内容
def main():
	N, Q = getlist()
	c = getlist()
	LR = []
	lastappeared = [None] * N

	ans = [0] * N
	for i in range(Q):
		l, r = getlist()
		l -= 1; r -= 1
		LR.append([r, l, i])

	LR.sort()
	bit = BIT(N + 1)
	right = 1
	for r, l, i in LR:
		while right <= r:
			if lastappeared[c[right] - 1] == None:
				bit.add(right, 1)
			else:
				bit.add(lastappeared[c[right] - 1], -1)
				bit.add(right, 1)
			lastappeared[c[right] - 1] = right

			right += 1

		if l == 1:
			anspre = bit.sum(r)
		else:
			anspre = bit.sum(r) - bit.sum(l - 1)
		ans[i] = anspre

	for i in range(Q):
		print(ans[i])



if __name__ == '__main__':
	main()

### FIXED CODE ###

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

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

class SegmentTree(object):
	#N:処理する区間の長さ
	def __init__(self, N):
		self.N = N
		self.N0 = 2 ** (N - 1).bit_length()
		self.initVal = 0
		self.data = [self.initVal] * (2 * self.N0)

	# 区間クエリの種類
	def calc(self, a, b):
		return a + b

	#k番目の値をxに更新
	def update(self, k, x):
		k += self.N0 - 1
		self.data[k] = x
		while k > 0:
			k = (k - 1) // 2
			self.data[k] = self.calc(self.data[2 * k + 1], self.data[2 * k + 2])

	#区間[l, r]の演算値
	def query(self, l, r):
		L = l + self.N0; R = r + self.N0 + 1
		m = self.initVal
		while L < R:
			if R & 1:
				R -= 1
				m = self.calc(m, self.data[R - 1])
			if L & 1:
				m = self.calc(m, self.data[L - 1])
				L += 1
			L >>= 1; R >>= 1

		return m

#処理内容
def main():
	N, Q = getlist()
	c = getlist()
	LR = []
	lastappeared = [None] * N

	ans = [0] * Q
	for i in range(Q):
		l, r = getlist()
		l -= 1; r -= 1
		LR.append([r, l, i])

	LR.sort(key = lambda x:x[0])
	Seg = SegmentTree(N)
	right = 0
	for r, l, i in LR:
		while right <= r:
			itr = c[right] - 1
			if lastappeared[itr] == None:
				Seg.update(right, 1)
			else:
				Seg.update(lastappeared[itr], 0)
				Seg.update(right, 1)
			lastappeared[itr] = right
			right += 1

		if l == 0:
			anspre = Seg.query(0, r)
		else:
			anspre = Seg.query(l, r)
		ans[i] = anspre

	for i in range(Q):
		print(ans[i])



if __name__ == '__main__':
	main()
n = int(input())
a = list(int(input()) for i in range(n))
s = 0
c = 0

while s != 1 and c < n:
    c += 1
    s = a[s]
if c < n:
    print(c)
else:
    print(-1)

### FIXED CODE ###

n = int(input())
a = list(int(input())-1 for i in range(n))
s = 0
c = 0

while s != 1 and c < n:
    c += 1
    s = a[s]
if c < n:
    print(c)
else:
    print(-1)
H, W = map(int,input().split())
S = [list(input()) for i in range(H)]
ansm = [[""]*W for i in range(H)]
for i in range(H):
    for j in range(W):
        cnt = 0
        if S[i][j]=="#":
            ansm[i][j]="#"
        else:
            if i>0 and j>0:
                if S[i-1][j-1]=="#":
                    cnt +=1
            if i>0:
                if S[i-1][j]=="#":
                    cnt+=1
            if i>0 and j<(W-1):
                if S[i-1][j+1]=="#":
                    cnt+=1
            if j>0:
                if S[i][j-1]=="#":
                    cnt+=1
            if j<W-1:
                if S[i][j+1]=="#":
                    cnt+=1
            if i<H-1 and j>0:
                if S[i+1][j-1]=="#":
                    cnt+=1
            if i<H-1:
                if S[i+1][j]=="#":
                    cnt+=1
            if i<H-1 and j<(W-1):
                if S[i+1][j+1]=="#":
                    cnt+=1
            ansm[i][j]=str(cnt)
ans = [""]*W
for i in range(H):
    for j in range(W):
        ans[i]=ans[i]+ansm[i][j]
for i in range(H):
    print(ans[i])

### FIXED CODE ###

H, W = map(int,input().split())
S = [list(input()) for i in range(H)]
ansm = [[""]*W for i in range(H)]
for i in range(H):
    for j in range(W):
        cnt = 0
        if S[i][j]=="#":
            ansm[i][j]="#"
        else:
            if i>0 and j>0:
                if S[i-1][j-1]=="#":
                    cnt +=1
            if i>0:
                if S[i-1][j]=="#":
                    cnt+=1
            if i>0 and j<(W-1):
                if S[i-1][j+1]=="#":
                    cnt+=1
            if j>0:
                if S[i][j-1]=="#":
                    cnt+=1
            if j<W-1:
                if S[i][j+1]=="#":
                    cnt+=1
            if i<H-1 and j>0:
                if S[i+1][j-1]=="#":
                    cnt+=1
            if i<H-1:
                if S[i+1][j]=="#":
                    cnt+=1
            if i<H-1 and j<(W-1):
                if S[i+1][j+1]=="#":
                    cnt+=1
            ansm[i][j]=str(cnt)
ans = [""]*H
for i in range(H):
    for j in range(W):
        ans[i]=ans[i]+ansm[i][j]
for i in range(H):
    print(ans[i])
#!/usr/bin/env python3
import math
# n進数の各位の和
def base_10_n(x,n):
    a = int(math.log(x,n))
    ans = 0
    for i in range(a,-1,-1):
        ans += x // n**i
        x %= n**i
    ans += x
    return ans

def main():
    N = int(input())
    ans = base_10_n(N,6)
    for j in range(1, (N//9)+1):
        c = base_10_n(N-9*j,6)
        d = base_10_n(9*j,9)
        ans = min(ans, c+d)
    print(ans)
    # print(base_10_n(-1,6))
    # print([i for i in range(2,-1,-1)])

if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import math
# n進数の各位の和


def base_10_n(x, n):
    if x == 0:
        return 0
    tmpx = x
    a = int(math.log(x, n))
    ans = 0
    for i in range(a, -1, -1):
        ans += tmpx // n**i
        tmpx %= n**i
    ans += tmpx
    return ans


def s(n, r):
    if n == 0:
        return 0
    return n % r + s(n // r, r)


def main():
    N = int(input())
    ans = 10**12
    for j in range(N+1):
        # c = base_10_n(N-j, 6)
        # d = base_10_n(j, 9)
        c = s(j,6)
        d = s(N-j,9)
        ans = min(ans, c+d)
    print(ans)


if __name__ == "__main__":
    main()
import sys
for d in int(sys.stdin):
  print sum([d*x*x for x in range(d,600,d)])

### FIXED CODE ###

import sys
for d in map(int, sys.stdin):
  print sum([d*x*x for x in range(d,600,d)])
from collections import defaultdict
N = int(input())
A = sorted([int(i) for i in input().split()], reverse=True)
A_dict = defaultdict(lambda:0)
for a in A:
    A_dict[a] += 1
key1 = 0
key2 = 0
for key in A_dict.keys():
    if key2 > 0:
        break

    if A_dict[key] > 3:
        if key1 == 0;
            key1 = key
        if key2 == 0;
            key2 = key
    elif A_dict[key] > 1:
        if key1 > 0:
            key2 = key
        else:
            key1 = key
print(key1*key2)

### FIXED CODE ###

from collections import defaultdict
N = int(input())
A = sorted([int(i) for i in input().split()], reverse=True)
A_dict = defaultdict(lambda:0)
for a in A:
    A_dict[a] += 1
key1 = 0
key2 = 0
for key in sorted(A_dict.keys(), reverse=True):
    if key2 > 0:
        break

    if A_dict[key] > 3:
        if key1 == 0:
            key1 = key
        if key2 == 0:
            key2 = key
    elif A_dict[key] > 1:
        if key1 > 0:
            key2 = key
        else:
            key1 = key
print(key1*key2)
import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def II(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def SI(): return input()
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')

li = []
for i in range(5):
    li.append(II())

sum_ = 0
li_mod = []
for i in li:
    if i%10 == 0:
        sum_ += i
    else:
        sum_ += ((i//10)+1)*10
        li_mod.append(10-i%10)
sum_ -= max(li_mod)

print(sum_)


### FIXED CODE ###

import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def II(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def SI(): return input()
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')

li = []
for i in range(5):
    li.append(II())

sum_ = 0
li_mod = []
for i in li:
    if i%10 == 0:
        sum_ += i
    else:
        sum_ += ((i//10)+1)*10
        li_mod.append(10-i%10)
if li_mod:
    sum_ -= max(li_mod)

print(sum_)
n = int(input())
ptint('ACL'*n)

### FIXED CODE ###

n = int(input())
print('ACL'*n)
import math
w, a, b = [int(i) for i in input().split()]
if a+w < b:
    print(int(math.fabs(b-a-w)))
elif b+w < a:
    print(int(math.fabs(b+w-a)))
else:
    print(int(0))
                


### FIXED CODE ###

a, b = [(i) for i in input().split()]
if a == 'H':
    if b == 'H':
        print('H')
    else:
        print('D')
else:
    if b == 'H':
        print('D')
    else:
        print('H')
w,h,x,y=map(int,input().split())
huku=0
if w/x==2 and h/y==2:
  huku=1
print(w*h/2,huku)

### FIXED CODE ###

w,h,x,y=map(int,input().split())
huku=0
if w/2==x and h/2==y:
  huku=1
print(w*h/2,huku)
import copy
n, q = [int(i) for i in input().split()]
As = sorted([int(i) for i in input().split()])
for i in range(q):
    x = int(input())
    As_tmp = copy.copy(As)
    As_abs = [abs(a - x) for a in As]
    ans = 0
    # print(As_abs)
    while As_abs:
        ans += As_tmp[-1]
        # print(ans)
        As_tmp.pop(-1)
        As_abs.pop(-1)
        if not As_abs:
            break
        # ans += As[As_abs.index(min(As_abs))]
        idx = As_abs.index(min(As_abs))
        As_tmp.pop(idx)
        As_abs.pop(idx)
        # print(As_abs)
 
    print(ans)

### FIXED CODE ###

n, h, w = int(input()), int(input()), int(input())
print((n-h+1)*(n-w+1))