Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N = int(input())
S = input()
num_E = []
num_W = []
num_All = []

for i in range(N):
  num_E.append(S[i+1:].count('E'))
  num_W.append(S[:i].count('W'))

num_All = [x + y for (x, y) in zip(num_E, num_W)]
print(min(num_All))


### FIXED CODE ###

N = int(input())
S = input()
num_E = []
num_W = []
num_All = []
count_W = 0
count_E = 0

for i in range(N):
  if S[i] == 'W':
    count_W += 1
  if S[N-i-1] =='E':
    count_E += 1
  num_W.append(count_W)
  num_E.append(count_E)

num_E.reverse()
num_All = [x + y for (x, y) in zip(num_W, num_E)]

print(min(num_All)-1)
### BUGGY CODE ###

class SegmentTree():
    def __init__(self, S):
        # S:英小文字からなる配列
        # tmp = len(S)
        # cnt = 0
        # while tmp // 2 > 0:
        #     tmp //= 2
        #     cnt += 1
        self.size = 20
        # sizeはSの長さ<=2**nをみたす最小のn
        self.array = [set()] * (2**(self.size + 1) - 1)
        for i, c in enumerate(S):
            self.array[i + 2**self.size - 1] = {c}
        for i in range(2**self.size - 1)[::-1]:
            self.array[i] = self.array[2 * i + 1] | self.array[2 * i + 2]

    def subquery(self, l, r, k, i, j):
        # 区間[i,j)の中で区間[l,r)の文字列の集合を返す
        if j <= l or r <= i:
            return set()
        elif l <= i and j <= r:
            return self.array[k]
        else:
            l_set = self.subquery(l, r, 2 * k + 1, i, (i + j) // 2)
            r_set = self.subquery(l, r, 2 * k + 2, (i + j) // 2, j)
            return l_set | r_set

    def query(self, l, r):
        # [l,r)に含まれる文字の種類数
        return len(self.subquery(l, r, 0, 0, 2**self.size))

    def update(self, i, c):
        tmp = i + 2**self.size - 1
        self.array[tmp] = {c}
        while tmp > 0:
            tmp = (tmp - 1) // 2
            self.array[tmp] = self.array[2 * tmp + 1] | self.array[2 * tmp + 2]


N = int(input())
S = list(input())
Q = int(input())
tree = SegmentTree(S)
for q in range(Q):
    t, i, c = input().split()
    if t == '1':
        i = int(i) - 1
        tree.update(i, c)
    else:
        l, r = int(i) - 1, int(c)
        print(tree.query(l, r))
# S = ['a', 'b', 'c', 'd', 'b', 'b', 'd']
# tree = SegmentTree(S)
# print(tree.query(2, 6))


### FIXED CODE ###

import sys
input = sys.stdin.readline


class SegmentTree():
    def __init__(self, S):
        self.size = 19
        self.array = [set()] * (2**(self.size + 1) - 1)
        for i, c in enumerate(S):
            self.array[i + 2**self.size - 1] = {c}
        for i in range(2**self.size - 1)[::-1]:
            self.array[i] = self.array[2 * i + 1] | self.array[2 * i + 2]

    def subquery(self, l, r, k, i, j):
        # 区間[i,j)の中で区間[l,r)の文字列の集合を返す
        if j <= l or r <= i:
            return set()
        elif l <= i and j <= r:
            return self.array[k]
        else:
            l_set = self.subquery(l, r, 2 * k + 1, i, (i + j) // 2)
            r_set = self.subquery(l, r, 2 * k + 2, (i + j) // 2, j)
            return l_set | r_set

    def query(self, l, r):
        # [l,r)に含まれる文字の種類数
        return len(self.subquery(l, r, 0, 0, 2**self.size))

    def update(self, i, c):
        tmp = i + 2**self.size - 1
        self.array[tmp] = {c}
        while tmp > 0:
            tmp = (tmp - 1) // 2
            self.array[tmp] = self.array[2 * tmp + 1] | self.array[2 * tmp + 2]


def main():
    N = int(input())
    S = [ord(_) - 97 for _ in list(input())]
    Q = int(input())
    tree = SegmentTree(S)
    for q in range(Q):
        t, i, c = input().split()
        if t == '1':
            i = int(i) - 1
            tree.update(i, ord(c) - 97)
        else:
            l, r = int(i) - 1, int(c)
            print(tree.query(l, r))


if __name__ == '__main__':
    main()
### BUGGY CODE ###

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

from collections import deque 
s=deque(s0())
n=n0()
q=s2(n)

for a in q:
    if a[0]=="1":
        s.reverse()
    else:
        b=a.split()
        if b[1]=="1":
            s.appendleft(b[2])
        else:
            s.append(b[2])
print(''.join(list(s)))

### FIXED CODE ###

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

from collections import deque 
s=s0()
n=n0()
q=s2(n)

d1=deque()
d2=deque()

f=False
for a in q:
    if a[0]=="1":
        f=not(f)
    else:
        if a[2]=="1":
            if f==False:
                d1.appendleft(a[4])
            else:
                d2.append(a[4])                
        else:
            if f==False:
                d2.append(a[4])
            else:
                d1.appendleft(a[4])
ss=''.join(list(d1))+s+''.join(list(d2))
print(ss[::-1] if f else ss)
### BUGGY CODE ###

N = int(input())
S = input()
d = {
    'R': [],
    'G': [],
    'B': []
}
for i, s in enumerate(S):
    d[s].append(i)

answer = 0
for r in d['R']:
    for g in d['G']:
        for b in d['B']:
            s = sorted([r, g, b], reverse=True)
            if s[0] - s[1] != s[1] - s[2]:
                answer += 1
print(answer)

### FIXED CODE ###

N = int(input())
S = input()
d = {
    'R': {},
    'G': {},
    'B': {}
}
for i, s in enumerate(S):
    d[s][i] = True
answer = len(d['R']) * len(d['G']) * len(d['B'])
for r in d['R'].keys():
    for g in d['G'].keys():
        if 2 * r - g in d['B']:
            answer -= 1
        if 2 * g - r in d['B']:
            answer -= 1
        if ((r + g) % 2 == 0 and ((r + g) // 2) in d['B']):
            answer -= 1
            

print(answer)
### BUGGY CODE ###

A = list(map(int, input().split())) 
B = list(map(int, input().split())) 
import itertools

l=[]
for v in itertools.combinations(B, A[1]):
  l.append(sum(v))
  
print(min(l))

### FIXED CODE ###

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

B.sort()

print(sum(B[:A[1]]))
### BUGGY CODE ###

#-*- coding:utf-8 -*-
import sys

#入力されたデータに関して2つとも素数の組の数を返す
def both_prime(num):

    #素数リストの生成
    M = 10001
    primes = [1]*M
    primes[0], primes[1] = 0,0
    for i in range(2,M):
        if primes[i]:
            j = 2
            while j*i < M:
                primes[j*i] = 0
                j += 1

    #各データについて偶数奇数で場合分け
    #偶数
    if num%2 == 0:
        if primes[num-1]:
            return "2"
        else:
            return "0"
    elif num==3:
        return "1"
    #奇数
    else:
        c = 0 #カウント
        for i in range(num/2):
            if (i+1)%2==0:
                continue
            else:
                if primes[i+1] and primes[num-i]:
                    c += 1
        return c*2

if __name__=="__main__":
    lines = []
    for line in sys.stdin:
        print both_prime(int(line.replace("\n","")))

### FIXED CODE ###

#-*- coding:utf-8 -*-

#素数リストの生成
M = 10001
primes = [1]*M
primes[0], primes[1] = 0,0
for i in range(2,101):
    if primes[i]:
        j = 2
        while j*i < M:
            primes[j*i] = 0
            j += 1


#入力されたデータに関して2つとも素数の組の数を返す
def both_prime(num):

    #各データについて偶数奇数で場合分け
    #偶数
    if num%2 == 0:
        if primes[num-1]:
            return 2
        else:
            return 0
    #奇数
    else:
        c = 0 #カウント
        for i in range(num/2):
            if (i+1)%2==0:
                continue
            else:
                if primes[i+1] and primes[num-i]:
                    c += 1
        c *= 2
        if primes[num/2+1]:
            c += 1
        return c

if __name__=="__main__":
    while 1:
        try:
            n = int(raw_input())
            print both_prime(n)
        except:
            break
### BUGGY CODE ###

import sys
import time
now = time.time()
input = sys.stdin.readline
S = input().strip()
mod = 10**9+7
a = 0
ab = 0
ans = 0
q = 1
for c in S:
    if c == 'A':
        a += q
    elif c == 'B':
        ab += a
    elif c == 'C':
        ans += ab
    elif c == '?':
        a, ab, ans, q = a*3+q, ab*3+a, ans*3+ab, q*3
print(ans % mod)


### FIXED CODE ###

import sys
input = sys.stdin.readline
S = input().strip()
mod = 10**9+7
a = 0
ab = 0
ans = 0
q = 1
for c in S:
    if c == 'A':
        a += q
    elif c == 'B':
        ab += a
    elif c == 'C':
        ans += ab
    elif c == '?':
        a, ab, ans, q = a*3+q, ab*3+a, ans*3+ab, q*3
    a %= mod
    ab %= mod
    ans %= mod
    q %= mod
print(ans % mod)
### BUGGY CODE ###

import sys
input = sys.stdin.readline


def pack(C):
    bitmask = 0
    for c in C:
        d = 1 << (c-1)
        bitmask |= d
    return bitmask


def read():
    N, M = list(map(int, input().strip().split()))
    A = list()
    C = list()
    for i in range(M):
        a, b = list(map(int, input().strip().split()))
        A.append(a)
        c = map(int, input().strip().split())
        C.append(pack(c))
    return N, M, A, C


def solve(N, M, A, C, INF=10**9):
    # dp[state][i]: i本の鍵[0, i)を使って状態stateにするための最小コスト
    n_states = 1 << N
    end_state = n_states - 1
    dp = [[INF for j in range(M+1)] for state in range(n_states)]
    for j in range(M+1):
        dp[0][j] = 0

    for j in range(M):
        for state in range(n_states):
            next_state = state | C[j]
            dp[state][j+1] = min(dp[state][j+1], dp[state][j])
            if next_state > state:
                dp[next_state][j+1] = min(dp[next_state][j+1], dp[state][j] + A[j])
    
    min_cost = INF
    for j in range(M):
        min_cost = min(min_cost, dp[end_state][j])
    return min_cost if min_cost != INF else -1


if __name__ == "__main__":
    inputs = read()
    print("%s" % solve(*inputs))


### FIXED CODE ###

import sys
input = sys.stdin.readline


def pack(C):
    bitmask = 0
    for c in C:
        d = 1 << (c-1)
        bitmask |= d
    return bitmask


def read():
    N, M = list(map(int, input().strip().split()))
    A = list()
    C = list()
    for i in range(M):
        a, b = list(map(int, input().strip().split()))
        A.append(a)
        c = map(int, input().strip().split())
        C.append(pack(c))
    return N, M, A, C


def solve(N, M, A, C, INF=10**9):
    # dp[state][i]: i本の鍵[0, i)を使って状態stateにするための最小コスト
    n_states = 1 << N
    end_state = n_states - 1
    dp = [[INF for j in range(2)] for state in range(n_states)]
    dp[0][0] = 0
    dp[0][1] = 0

    for j in range(M):
        m0 = j & 1
        m1 = 1 - m0
        for state in range(n_states):
            next_state = state | C[j]
            dp[state][m1] = min(dp[state][m1], dp[state][m0])
            if next_state > state:
                dp[next_state][m1] = min(dp[next_state][m1], dp[state][m0] + A[j])
    
    m0 = M & 1
    return dp[end_state][m0] if dp[end_state][m0] != INF else -1


if __name__ == "__main__":
    inputs = read()
    print("%s" % solve(*inputs))
### BUGGY CODE ###

H,W=map(int, input().split()) 
S=[[0 for _ in range(W+2)] for _ in range(H+2)]
for i in range(H):
  S[i+1]= ["#"] + list(input()) + ["#"]
for j in range(W+2):
  S[0][j]="#"
  S[-1][j]="#"
  
t=[[-1 for _ in range(W)] for _ in range(H)]
y=[[-1 for _ in range(W)] for _ in range(H)]

for i in range(H):
  for j in range(W):
    if S[i+1][j+1]==".":
      if t[i][j]==-1:
        k=1
        while True:
          if S[i+k+1][j+1]==".":
            k +=1
          else:
            break
        for l in range(k):
          t[i+l][j]=k       
      if y[i][j]==-1:
        m=1
        while True:
          if S[i+1][j+1+m]==".":
            m +=1
          else:
            break
        for n in range(m):
          y[i][j+n]=m       

maxi=0          
for i in range(H):
  for j in range(W):
    maxi=max(maxi, t[i][j]+y[i][j])
print(maxi-1)

### FIXED CODE ###

H,W=map(int, input().split()) 
S=[[0 for _ in range(W+2)] for _ in range(H+2)]
for i in range(H):
  S[i+1]= ["#"] + list(input()) + ["#"]
for j in range(W+2):
  S[0][j]="#"
  S[-1][j]="#"
  
t=[[-1 for _ in range(W)] for _ in range(H)]
y=[[-1 for _ in range(W)] for _ in range(H)]

for i in range(H):
  for j in range(W):
    if S[i+1][j+1]==".":
      if t[i][j]==-1:
        k=1
        while True:
          if S[i+k+1][j+1]==".":
            k +=1
          else:
            break
        for l in range(k):
          t[i+l][j]=k       
      if y[i][j]==-1:
        m=1
        while True:
          if S[i+1][j+1+m]==".":
            m +=1
          else:
            break
        for n in range(m):
          y[i][j+n]=m       

maxi=0          
for i in range(H):
  for j in range(W):
    maxi=max(maxi, t[i][j]+y[i][j])
print(maxi-1)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
p = [int(x) for x in input().split()]

x = []
ok = 1

for i in range(1,n):
    res = "ok"
    for j in range(i):
        #print(j,i,p[j],p[i])
        if p[j] < p[i]:
            res = "ng"
            break
    if res == "ok":
        ok = ok + 1

print(ok)


### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
p = [int(x) for x in input().split()]

ok = 1
minp = [p[0]]

for i in range(1,n):
    if p[i] < minp[i-1]:
        minp.append(p[i])
        ok = ok + 1
    else:
        minp.append(minp[i-1])

print(ok)
### BUGGY CODE ###

N, K = map(int, input().split())
A = sorted(list(map(int, input().split())))
F = sorted(list(map(int, input().split())), reverse=True)

def isEaten(x):
    temp = 0
    for i in range(N):
        t = x // F[i]
        if t < A[i]:
            temp += (A[i] - t)
    if temp > K:
        return False
    else:
        return True


def bitSearch(r, l):
    m = (r+l) // 2
    if m == l:
        if isEaten(l):
            print(l)
        else:
            print(r)
        exit()
    elif isEaten(m):
        bitSearch(m, l)
    else:
        bitSearch(r, m)


target = max([A[i]*F[i] for i in range(N)])
bitSearch(target, 0)


### FIXED CODE ###

N, K = map(int, input().split())
A = sorted(list(map(int, input().split())))
F = sorted(list(map(int, input().split())), reverse=True)
 
def isEaten(x):
    temp = 0
    for i in range(N):
        t = x // F[i]
        if t < A[i]:
            temp += (A[i] - t)
    return temp <= K
 
 
def bitSearch(r, l):
    m = (r+l) // 2
    if m == l:
        if isEaten(l):
            print(l)
        else:
            print(r)
        exit()
    elif isEaten(m):
        bitSearch(m, l)
    else:
        bitSearch(r, m)
 
 
target = max([A[i]*F[i] for i in range(N)])
bitSearch(target, 0)
### BUGGY CODE ###

n = int(input())
sl = list(map(int,input().split()))
l = []
for i in range(len(sl)):
    for j in range(i+1,len(sl)):
        l.append(sl[i]^sl[j])
print(sum(l)%((10**9)+7))

### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))
ans = 0
for i in range(60):
    c0 = 0
    c1 = 0
    c1 = sum([1 for a in l if (a>>i) & 1])
    c0 = n - c1
    ans += (c1*c0)*(2**i)
print(ans%((10**9)+7))
### BUGGY CODE ###

class UnionFind():
   def __init__(self, n):
       self.n = n
       self.parents = [-1] * n

   def find(self, x):
       if self.parents[x] < 0:
           return x
       else:
           self.parents[x] = self.find(self.parents[x])
           return self.parents[x]

   def union(self, x, y):
       x = self.find(x)
       y = self.find(y)

       if x == y:
           return

       if self.parents[x] > self.parents[y]:
           x, y = y, x

       self.parents[x] += self.parents[y]
       self.parents[y] = x

   def size(self, x):
       return -self.parents[self.find(x)]

   def same(self, x, y):
       return self.find(x) == self.find(y)

   def members(self, x):
       root = self.find(x)
       return [i for i in range(self.n) if self.find(i) == root]

   def roots(self):
       return [i for i, x in enumerate(self.parents) if x < 0]

   def group_count(self):
       return len(self.roots())

   def all_group_members(self):
       return {r: self.members(r) for r in self.roots()}

   def __str__(self):
       return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


n,m = map(int,input().split())
pl = list(map(int,input().split()))
uf = UnionFind(n)
for _ in range(m):
   x,y = map(int,input().split())
   uf.union(x-1,y-1)
ans = 0
for member in uf.all_group_members().values():
   a = [pl[i]-1 for i in member]
   ans += len(set(a) & set(member))

print(ans)

### FIXED CODE ###

class UnionFind():
   def __init__(self, n):
       self.n = n
       self.parents = [-1] * n

   def find(self, x):
       if self.parents[x] < 0:
           return x
       else:
           self.parents[x] = self.find(self.parents[x])
           return self.parents[x]

   def union(self, x, y):
       x = self.find(x)
       y = self.find(y)

       if x == y:
           return

       if self.parents[x] > self.parents[y]:
           x, y = y, x

       self.parents[x] += self.parents[y]
       self.parents[y] = x

   def size(self, x):
       return -self.parents[self.find(x)]

   def same(self, x, y):
       return self.find(x) == self.find(y)

   def members(self, x):
       root = self.find(x)
       return [i for i in range(self.n) if self.find(i) == root]

   def roots(self):
       return [i for i, x in enumerate(self.parents) if x < 0]

   def group_count(self):
       return len(self.roots())

   def all_group_members(self):
       return {r: self.members(r) for r in self.roots()}

   def __str__(self):
       return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


n,m = map(int,input().split())
pl = list(map(int,input().split()))
uf = UnionFind(n)
for _ in range(m):
   x,y = map(int,input().split())
   uf.union(x-1,y-1)
ans = 0
for idx,p in enumerate(pl):
   ans += uf.same(p-1,idx)
print(ans)
### BUGGY CODE ###

import sys
from copy import deepcopy
from functools import lru_cache
sys.setrecursionlimit(10**6)

def main():
    #node i is list of [child,size,comb] connected i
    #return [size,comb]
    @lru_cache(maxsize=1000000)
    def deep(i,parent):
        if len(node[i])==1 and parent!=-1:
            return (1,1)
        mysize=0
        mycomb=1
        for j in node[i]:
            if j!=parent:
                size,comb=deep(j,i)
                mysize+=size
                mycomb=(mycomb*comb)%mod
                mycomb=(mycomb*inv[size])%mod
        mycomb=(mycomb*fact[mysize])%mod
        return (mysize+1,mycomb)

    F = 2*10**5
    mod = 10**9+7
    fact = [1]*F
    inv = [1]*F
    for i in range(2,F):
        fact[i]=(fact[i-1]*i)%mod
    inv[F-1]=pow(fact[F-1],mod-2,mod)
    for i in range(F-2,1,-1):
        inv[i] = (inv[i+1]*(i+1))%mod
    
    n=int(input())
    node=[[] for i in range(n)]
    for i in range(n-1):
        a,b=map(int,input().split())
        node[a-1].append(b-1)
        node[b-1].append(a-1)
    for i in range(n):
        print(deep(i,-1)[1])

main()


### FIXED CODE ###

n=int(input())
F = n+5
mod = 10**9+7
fact = [1]*F
inv = [1]*F
for i in range(2,F):
    fact[i]=(fact[i-1]*i)%mod
inv[F-1]=pow(fact[F-1],mod-2,mod)
for i in range(F-2,1,-1):
    inv[i] = (inv[i+1]*(i+1))%mod

#invnum[0] cant be used
invnum=[fact[i-1]*inv[i] for i in range(n)]

graph=[[] for i in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

stack=[0]
order=[0]
parent=[-1]*n
comb=[0]*n
size=[1]*n

# BFS order
while stack:
    node = stack.pop()
    for neib in graph[node]:
        if neib!=parent[node]:
            stack.append(neib)
            order.append(neib)
            parent[neib]=node

#calc size including self
for node in order[n-1:0:-1]:
    size[parent[node]]+=size[node]

#calc root comb
comb[0]=fact[n-1]
for node in range(1,n):
    comb[0]*=invnum[size[node]]
    comb[0]%=mod

#calc all comb
for node in order[1:]:
    comb[node]=comb[parent[node]]*size[node]*invnum[n-size[node]]%mod

print(*comb,sep="\n")
### BUGGY CODE ###

N, M = map(int, input().split())

drink = []
ans = 0

for i in range(N):
    A, B = map(int, input().split())
    for j in range(B):
        drink.append(A)

drink.sort()

for i in range(M):
    ans += drink[i]

print(ans)

### FIXED CODE ###

N, M = map(int, input().split())

drink = []
sum = 0
count = 0

for i in range(N):
    A, B = map(int, input().split())
    drink.append([A, B])

drink.sort()


for d in drink:
    if count >= M:
            break
    for i in range(d[1]):
        sum += d[0]
        count += 1
        if count >= M:
            break

print(sum)
### BUGGY CODE ###

import numpy as np
N = int(input())
A = list(map(int, input().split()))
x = 0
for i in range(N):
    for j in range(N):
        if i < j:
            if j - i  == A[i] + A[j]:
                x += 1
print(x)

### FIXED CODE ###

import numpy as np
N = int(input())
A = list(map(int, input().split()))
d = {}
x = 0

for i, a in enumerate(A):
    if i+a not in d:
        d[i+a] = 1
    else:
        d[i+a] += 1
    if i-a in d:
        x += d[i-a] 

print(x)
### BUGGY CODE ###

# -*- coding: utf-8 -*-

import math
import itertools
import re

# 入力
N = int(input())
S = str(input())
#M1, D1 = map(int, input().split())

si = ""
cnt = 0
for i in range(1000) :
  
  si = str(i).zfill(3)
  flag = 0

  for x in range(N) :
    if S[x] == si[0] :
      S1 = S[(x+1):]
      #print (si + ":" + S1)
      for y in range(len(S1)) :
        if S1[y] == si[1] :
          S2 = S1[(y+1):]
          for z in range(len(S2)) :
            if S2[z] == si[2] :
              cnt += 1
              flag = 1
              break
        if flag == 1 :
          break
    if flag == 1 :
      break


print (cnt)
    
    

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
import math
import itertools
import re
 
# 入力
N = int(input())
S = str(input())
#M1, D1 = map(int, input().split())
 
si = ""
cnt = 0
for i in range(1000) :
  
  si = str(i).zfill(3)
  
  c = 0
  for x in range(N) :
    if S[x] == si[c] :
      c += 1
      if c == 3 :
        cnt += 1
        break    

print (cnt)
### BUGGY CODE ###

N, K, Q = map(int,input().split())
A = [int((input())) for i in range(Q)]
pt = [K for i in range(N)]

for i in range(Q):
    for j in range(N):
        if A[i] - 1 != j:
            pt[j] -= 1

for i in range(N):
    if pt[i] >= 1:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

N, K, Q = map(int,input().split())
A = [int((input())) for i in range(Q)]
pt = [K for i in range(N)]

import collections
ct = collections.Counter(A)

for i in range(N):
    if K - (Q - ct[i+1]) >= 1:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

import numpy as np
from collections import Counter

N = int(input())
A = Counter(map(int, input().split()))
S = (None, A[3] + A[2] + A[1], A[3] + A[2], A[3])

dp = np.zeros((S[1] + 1, S[2] + 1, S[3] + 1), dtype=float)
for l in range(1, S[1] + 1):
    for m in range(S[2] + 1):
        if l < m:
            break
        mk = min(m + 1, S[3] + 1)
        dp[l][m][:mk] = (dp[l - 1][m][:mk] * (l - m) + dp[l][m - 1][:mk] * (m - np.arange(mk)) + N) / l

        matr = np.tile(np.arange(mk) / l, (mk, 1))
        matr[np.tri(mk, dtype=bool)] = 1
        matr = np.multiply.accumulate(matr, axis=1)
        matr[np.tri(mk, k=-1, dtype=bool)] = 0
        np.asmatrix(matr)

        dp[l][m][:mk] = np.dot(dp[l][m][:mk], matr)
print(dp[S[1]][S[2]][S[3]])


### FIXED CODE ###

from collections import Counter

N = int(input())
A = Counter(map(int, input().split()))
S = [None, A[3] + A[2] + A[1], A[3] + A[2], A[3]]

dp = [[[0] * (S[3] + 1) for _ in range(S[2] + 1)] for __ in range(S[1] + 1)]

for l in range(1, S[1] + 1):
    for m in range(S[2] + 1):
        if l < m:
            break
        for k in range(S[3] + 1):
            if m < k:
                break
            dp[l][m][k] = (dp[l - 1][m][k] * (l - m) + dp[l][m - 1][k] * (m - k) + dp[l][m][k - 1] * k + N) / l
print(dp[S[1]][S[2]][S[3]])
### BUGGY CODE ###

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

ans = 1
check = 10 ** 18

for i in range(N):
    ans *= A[i]

if ans > check:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
A.sort()
if A[0] == 0:
    print(0)
    exit()

ans = 1
check = 10 ** 18

for i in range(N-1,-1,-1):
    ans *= A[i]
    if ans > check:
        print(-1)
        exit()

print(ans)