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

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

for i in range(1,N+1):
    out_A.append(A.index(i) + 1)
for i in range(N-1):
    print(out_A[i],end=' ')
print(out_A[N-1])

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
Q = [''] * N
for i in range(N):
    Q[A[i] - 1] = str(i + 1)
print(' '.join(Q))
### BUGGY CODE ###

s = input()
x = int(input())
n = len(s)

pos = [[] for __ in range(256)]
for i in range(n):
    pos[ord(s[i])].append(i)

f = set()
for c in range(97, 123):
    for i in pos[c]:
        for j in range(i, n):
            f.add(s[i:j+1])
    if len(f) >= x:
        break

def cmp(u, v):
    while len(u) < len(v): u = u + '1'
    while len(u) > len(v): v = v + '1'
    return u > v

p = [u for u in f]
for i in range(len(p)):
    for j in range(i+1, len(p)):
        if cmp(p[i], p[j]):
            p[i], p[j] = p[j], p[i]

print(p[x - 1])

### FIXED CODE ###

s = input()
x = int(input())
n = len(s)

pos = [[] for __ in range(256)]
for i in range(n):
    pos[ord(s[i])].append(i)

f = set()
for c in range(97, 123):
    for i in pos[c]:
        for j in range(x):
            f.add(s[i:i+j+1])
    if len(f) >= x:
        break

p = [u for u in f]
p.sort()
print(p[x - 1])
### BUGGY CODE ###

import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
#import numpy as np

#from math import gcd
from fractions import gcd

def main():
	n=int(input())
	A=list(map(int,input().split()))
	A.sort()
	a=1
	for i in A:
		a=a*i//gcd(a, i)
	ans=0
	for i in A:
		ans+=(a//i)
		ans%=mod
	print(ans)
	
	
	
	
	
	


if __name__ == "__main__":
	main()


### FIXED CODE ###

import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
#import numpy as np

#from math import gcd
from fractions import gcd

def main():
	n=int(input())
	A=list(map(int,input().split()))
	B=set(A)
	A=list(A)
	A.sort(reverse=True)
	a=1
	ans=0
	for i in A:
		g=gcd(a, i)
		ans *=i//g
		a=a*i//gcd(a, i)
		ans+=a//i
	
	
	
	
	print(ans%mod)
	
	
	
	
	
	


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

import fractions
from functools import reduce
import sys

sys.setrecursionlimit(100000)

def gcd(numbers):
  return reduce(fractions.gcd, numbers)

N = int(input())
A = list(map(int,input().split()))
M = 0
gcd_i = [0]*N
gcd_i[0] = A[0] 
for i in range(N):
  tmp = 0
  if i == 0:
    tmp = gcd(A[i+1:])
  elif i == N - 1:
    tmp = gcd(A[:i])
  else:
    tmp = gcd( A[0:i] + A[i+1:])
  M = max(M,tmp)  
print(M)

### FIXED CODE ###

import fractions

def gcd(n1,n2):
  if n1 == 0:
    return n2
  elif n2 == 0:
    return n1
  else:
    return fractions.gcd(n1,n2)

n = int(input())
a = list(map(int,input().split()))
l = [0]*(n+1)
r = [0]*(n+1)
for i in range(n+1):
  if i != 0:
    l[i] = gcd(l[i-1],a[i-1])
    r[n-i] = gcd(r[n+1-i],a[n-i])
m = [gcd(l[i],r[i+1]) for i in range(n)]
print(max(m))
### BUGGY CODE ###

import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
A=list(map(int,input().split()))

l=[0]*(N+1)
cnt=0

for k in range(N):
	for i in A:
		l[i]+=1
	l[A[k]]-=1

	for j in l:
		cnt+=(j*(j-1))//2
	print(cnt)
	cnt=0
	l=[0]*(N+1)


### FIXED CODE ###

import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
A=list(map(int,input().split()))

l=[0]*(N+1)
cnt=0

for i in A:
		l[i]+=1
		
for j in l:
		cnt+=(j*(j-1))//2

for k in range(N):
	print(cnt-l[A[k]]+1)
### BUGGY CODE ###

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

mod = 10**9+7
ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        ans += (A[i] ^ A[j])
print(ans % mod)

### FIXED CODE ###

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

mod = 10**9+7
ans = 0
for j in range(60):
    one_num = 0
    for i in A:
        if (i >> j) & 1:
            one_num += 1
    ans += one_num * (N - one_num) * 2**j
    ans %= mod
print(ans)
### BUGGY CODE ###

import numpy as np

def LI():
  return [int(s) for s in input().split()]

N,K,Q = LI()
A_s = np.array([K]*N)

for i in range(Q):
  seikai = int(input())
  for j in range(N):
    if j != (seikai-1):
      A_s[j]-=1
      
for i in range(N):
  if A_s[i] > 0:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

import numpy as np
 
def LI():
  return [int(s) for s in input().split()]
 
N,K,Q = LI()
Seikai_s = np.array([Q]*N)
 
for i in range(Q):
  seikai = int(input())
  Seikai_s[seikai-1]-=1
      
for i in range(N):
  if K-Seikai_s[i] > 0:
    print('Yes')
  else:
    print('No')
### BUGGY CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, Q: int, S: str, l: "List[int]", r: "List[int]"):
    ans = []
    carray = [0] * N
    for i in range(1,N):
        # print(S[i-1:i+1])
        # if(S[i-1:i+1] == 'AC'):
        #     carray[i:] = map(lambda x:x+1, carray[i:])
        if(S[i-1:i+1] == 'AC'):
            carray[i] = 1

    # print(carray)
    for i in range(Q):
        # print(carray[l[i]-1:r[i]])
        # t = carray[:r[i]+1].count(1)-carray[:l[i]].count(1)
        t = carray[l[i]:r[i]].count(1)
        ans.append(t)

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


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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
    Q = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    l = [int()] * (Q)  # type: "List[int]" 
    r = [int()] * (Q)  # type: "List[int]" 
    for i in range(Q):
        l[i] = int(next(tokens))
        r[i] = int(next(tokens))
    solve(N, Q, S, l, r)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, Q: int, S: str, l: "List[int]", r: "List[int]"):
    ans = []
    carray = [0] * N
    for i in range(1,N):
        if(S[i-1:i+1] == 'AC'):
            carray[i] = carray[i-1]+1 
            # carray[i:] = map(lambda x:x+1, carray[i:])
        else:
            carray[i] = carray[i-1]
    # print(carray)
    for i in range(Q):
        # print(carray[l[i]-1:r[i]])
        t = carray[r[i]-1] - carray[l[i]-1]
        ans.append(t)

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


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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
    Q = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    l = [int()] * (Q)  # type: "List[int]" 
    r = [int()] * (Q)  # type: "List[int]" 
    for i in range(Q):
        l[i] = int(next(tokens))
        r[i] = int(next(tokens))
    solve(N, Q, S, l, r)

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

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

def factorization(n):
    arr = set()
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.add(i)

    if temp!=1:
        arr.add(temp)

    if arr==[]:
        arr.add(n)

    return arr

com=factorization(A[0])
rem=factorization(A[0])

for i in range(1,N):
  rem=rem&factorization(A[i])
  if com=={0}:
    continue
  if com&factorization(A[i])==set() or com&factorization(A[i])=={1}:
    com=com.union(factorization(A[i]))
  else:
    com={0}
    
if com!={0}:
  print("pairwise coprime")
elif rem==set() or rem=={1}:
  print("setwise coprime")
else:
  print("not coprime")

### FIXED CODE ###

import math

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

a=max(A)
def era(n):
  prime=[]
  furui=list(range(2,n+1))
  while furui[0]<math.sqrt(n):
    prime.append(furui[0])
    furui=[i for i in furui if i%furui[0]!=0]
  return prime+furui

b=A[0]
for i in range(1,N):
  b=math.gcd(b,A[i])

if b!=1:
  print("not coprime")
  exit()

furui=era(10**6+7)
minfac=list(range(10**6+7))
for i in furui:
  for j in range(i,(10**6+7)//i):
    if minfac[i*j]==i*j:
      minfac[i*j]=i
      
dummy=[False]*(10**6+7)
for i in range(N):
  k=A[i]
  while k!=1:
    if dummy[minfac[k]]==True:
      print("setwise coprime")
      exit()
    else:
      dummy[minfac[k]]=True
      f=minfac[k]
      while k%f==0:
        k//=f
print("pairwise coprime")
### BUGGY CODE ###

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

ans = 0

for i in range(N):
    f = True
    for j in range(i, -1, -1):
        if P[i] > P[j]:
            f = False
            break
    if f == True: ans += 1


print(ans)


### FIXED CODE ###

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

ans = 1
index = P[0]

for i in range(1, N):
    if index > P[i]:
        index = P[i]
        ans += 1


print(ans)
### BUGGY CODE ###

n = int(input())
l = list(map(int,input().split()))
count = 0

import itertools
all_comb = list(itertools.combinations(l,3))

for i in range(len(all_comb)):
    a = all_comb[i][0]
    b = all_comb[i][1]
    c = all_comb[i][2]
    if a + b > c and b + c > a and c + a > b:
        count += 1
print(count)

### FIXED CODE ###

n = list(input())
l = sorted(list(map(int,input().split())))
count = 0

import bisect
for i in range(len(l)):
    for j in range(i+1,len(l)):
        end = bisect.bisect_left(l,l[i]+l[j])
        start = j
        count += end - start -1
print(count)
### BUGGY CODE ###

a,b,c,d = map(int, input().split())
e = 0
for l in range(a,b+1):
    if l%c == 0 or l%d == 0:
        e += 1
print(b-a-e+1)

### FIXED CODE ###

def gcd(a,b):
    while b:a,b=b,a%b
    return a
def lcm(c,d):return c*d//gcd(c,d)
def div(x):
    num=x
    num-=x//C
    num-=x//D
    num+=x//lcm(C,D)
    return num
A,B,C,D=map(int,input().split())
print(div(B)-div(A-1))
### BUGGY CODE ###

def resolve():
    N,K,Q = list(map(int,input().split()))
    A =[]
    for i in range(Q):
        A.append(input())
    P = []
    for i in range(N):
        P.append(K)
    def calc(n):
        return n-1

    for i in range(Q):
        P = list(map(calc,P))
        As = A[i]
        P[int(As)-1] += 1

    for i in range(N):
        if P[i] <= 0:
            print("No")
        else:
            print("Yes")
resolve()

### FIXED CODE ###

def resolve():
    N,K,Q = list(map(int,input().split()))
    A = [input() for i in range(Q)]
    P = [K] * N

    def calc(n):
        return n-Q

    for i in range(Q):
        P[int(A[i])-1] += 1

    P = list(map(calc, P))

    for i in range(N):
        if P[i] <= 0:
            print("No")
        else:
            print("Yes")
resolve()
### BUGGY CODE ###

import numpy as np

n = int(input())
a = np.array(list(map(int, input().split())))
b = np.array([i for i in range(1, n+1)])

ans = 0
for i in range(n-1):
  ans += ((a[i+1:] + a[i]) == b[:n-1-i]).sum()
print(ans)

### FIXED CODE ###

n = int(input())
alist = list(map(int, input().split()))

ans = 0
dic = {}
for i, a in enumerate(alist):
  if dic.get(str(i-a)) is not None:
    ans += dic[str(i-a)]
  if dic.get(str(i+a)) is not None:
    dic[str(i+a)] += 1
  else:
    dic[str(i+a)] = 1
print(ans)
### BUGGY CODE ###

from collections import deque
import copy

N,K = map(int,input().split(" "))

V = deque(map(int,input().split(" ")))

def search(N,K,V,score,a,b):
    if a+b < min(N,K):
        Vb = copy.copy(V)
        Va = copy.copy(V)
        scoreA = copy.copy(score)
        scoreB=copy.copy(score)
        scoreA.append(Va.popleft())
        A = search(N,K,Va,scoreA,a+1,b)
        scoreB.append(Vb.pop())
        B = search(N,K,Vb,scoreB,a,b+1)
    score=sorted(score)
    counter = 0
    while(counter < K-a-b):
        if len(score)== 0:
            break;
        if score[0]<0:
            score.pop(0)
            counter +=1
        else:
            break;
    ans = sum(score)
    if a+b < min(N,K):
        return max(0,ans,A,B)
    else:
        return max(0,ans)

score = []
a = 0
b= 0
ans = search(N,K,V,score,a,b)
print(ans)

### FIXED CODE ###

from collections import deque

N,K = map(int,input().split(" "))

V = deque(map(int,input().split(" ")))

def search(N,K,V,score):
    ans = 0
    for i in range(min(N,K)+1):
        for j in range(min(N,K)-i+1):
            score = []
            for a in range(i):#do operation A
                score.append(V[a])
            for b in range(j):#do operation B
                score.append(V[len(V)-b-1])
            score=sorted(score)
            counter = 0

            while(counter < K-i-j):#do operation C,D
                if len(score)== 0:
                    break;
                if score[0]<0:
                    score.pop(0)
                    counter +=1
                else:
                    break;   
            ans = max(ans,sum(score))

    return ans

score = []
ans = search(N,K,V,score)
print(ans)
### BUGGY CODE ###

k,s = input().split(' ')
k,s = int(k),int(s)


count = 0
for i in range(k+1):
	if i > s:
		break
	for j in range(k+1):
		if i+j > s:
			break
		for l in range(k+1):
			x = i+j+l
			if s == x:
				count += 1

print(count)

### FIXED CODE ###

k,s = input().split(' ')
k,s = int(k),int(s)


count = 0
for i in range(k+1):
	for j in range(k+1):
		z = s - (i+j)
		if z <= k and z >= 0:
			count += 1
print(count)
### BUGGY CODE ###

memo = {}

def gcd(a, b):
    if (a, b) in memo.keys():
        return memo[(a, b)]
    if b == 0:
        return a
    return gcd(b, a % b)

n = int(input())
a_list = list(map(int, input().split()))
max_g = 0
for exclude in range(n):
    g = a_list[0] if exclude > 0 else a_list[1]
    for i, a in enumerate(a_list):
        if i == 0 or i == exclude:
            continue
        g_new = gcd(g, a)
        if (g, a) not in memo:
            memo[(g, a)] = g_new
        g = g_new
        if g <= max_g:
            break
    if g > max_g:
        max_g = g
print(max_g)


### FIXED CODE ###

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

n = input()
a_list = map(int, raw_input().split())

gs1 = [None] * n
gs1[0] = a_list[0]
for i in xrange(1, n):
    gs1[i] = gcd(gs1[i - 1], a_list[i])

gs2 = [None] * n
gs2[n - 1] = a_list[n - 1]
for i in reversed(xrange(n - 1)):
    gs2[i] = gcd(gs2[i + 1], a_list[i])

max_g = 0
for exclude in xrange(n):
    if exclude == 0:
        g = gs2[1]
    elif exclude == n - 1:
        g = gs1[n - 2]
    else:
        g = gcd(gs1[exclude - 1], gs2[exclude + 1])
    if g > max_g:
        max_g = g
print(max_g)
### BUGGY CODE ###

from collections import defaultdict
import math

def gcd(a, b):
    if a < b:
        return gcd(b, a)
    while b > 0:
        a, b = b, a % b
    return a

def sieve_of_eratosthenes(n):
    sieve = list(range(n+1))
    m = int(math.sqrt(n))
    for i in range(2, m + 1):
        if sieve[i] < i:
            continue
        for j in range(i * i, n + 1, i):
            if sieve[j] == j:
                sieve[j] = i
    return sieve

def factorize_by_sieve(x, sieve):
    factor = defaultdict(int)
    while sieve[x] != x:
        factor[sieve[x]] += 1
        x //= sieve[x]
    factor[x] += 1
    return factor

n = int(input())
a_list = list(map(int, input().split()))
a_list.sort()

sieve = sieve_of_eratosthenes(a_list[-1])
pairwise = True
setwise = True
primes = set()
x = a_list[0]
for a in a_list:
    x = gcd(x, a)
    if pairwise and a != 1:
        factor = factorize_by_sieve(a, sieve).keys()
        pairwise = primes.isdisjoint(factor)
        primes |= factor

if pairwise:
    print("pairwise coprime")
elif x == 1:
    print("setwise coprime")
else:
    print("not coprime")




### FIXED CODE ###

from collections import defaultdict

def gcd(a, b):
    if a < b:
        return gcd(b, a)
    while b > 0:
        a, b = b, a % b
    return a

def sieve_of_eratosthenes(n):
    sieve = [0] * (n+1)
    sieve[0] = 1 #素数でない
    sieve[1] = 1 #素数でない
    for i in range(2, n):
        if sieve[i] == 0:
            for j in range(2, n // i + 1):
                sieve[i * j] = i
    return sieve

def factorize_by_sieve_of_eratosthenes(x, sieve):
    factor = defaultdict(int)
    while sieve[x]:
        factor[sieve[x]] += 1
        x //= sieve[x]
    factor[x] += 1
    return factor

n = int(input())
a_list = list(map(int, input().split()))
a_list.sort()

sieve = sieve_of_eratosthenes(a_list[-1])
pairwise = True
setwise = True
primes = set()
x = a_list[0]
for a in a_list:
    x = gcd(x, a)
    if pairwise and a != 1:
        factor = set(factorize_by_sieve_of_eratosthenes(a, sieve).keys())
        if not primes.isdisjoint(factor):
            pairwise = False
        else:
            primes |= factor

if pairwise:
    print("pairwise coprime")
elif x == 1:
    print("setwise coprime")
else:
    print("not coprime")
### BUGGY CODE ###

import sys
sys.setrecursionlimit(500000)

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def gcd_list(li):
	if len(li) > 2:
		x = gcd(li[-1], li[-2])
		li = li[:-2] + [x]
		return gcd_list(li)
	else:
		return gcd(li[0], li[1])

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

x = list(map(int, input().split()))

li = [abs(i - X) for i in x]

# li = [i for i in li if i]
li.reverse()
if len(li) == 1:
	print(li[0])
else:
	print(gcd_list(li))

### FIXED CODE ###

import sys
sys.setrecursionlimit(500000)

def gcd(a, b):
	# while b:
	# 	a, b = b, a % b
	# return a

	if b:
		return gcd(b, a % b)
	else:
		return a

def gcd_list(li):
	if len(li) > 2:
		x = gcd(li[-1], li[-2])
		li = li[:-2] + [x]
		return gcd_list(li)
	else:
		return gcd(li[0], li[1])

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

x = list(map(int, input().split()))

li = [abs(i - X) for i in x]

# li = [i for i in li if i]
# li = sorted(li)
if len(li) == 1:
	print(li[0])
else:
	ans = li[0]
	for i in range(1,N):
		ans = gcd(ans, li[i])
	print(ans)
### BUGGY CODE ###

n = int(input())

p = [i + 2 for i in range(n-1)]
p = p + [1]

m = 0

for i in range(n):
  m += (i+1) % p[i]
  
print(m)

### FIXED CODE ###

n = int(input())
print(n * (n-1) // 2)
### BUGGY CODE ###

nk = input().split()
seisuuretu = input().split()

for i in range(len(seisuuretu)):
    seisuuretu[i] = int(seisuuretu[i])

all_seisuuretu = []

for start in range(len(seisuuretu) + 1):
    for end in range(len(seisuuretu) + 1):
        if start < end:
            all_seisuuretu.append(seisuuretu[start:end])

set_max = set()
beautiful_set = set()
beautiful_list = []
for pattern in all_seisuuretu:
    temp_pattern = bin(sum(pattern))[2:]
    beautiful_set |= {temp_pattern}
    set_max |= {len(temp_pattern)}

beautiful_list = list(beautiful_set)
list_max = -max(set_max)

status = True
while status == True:
    temp = []
    count = 0
    len_all = 0
    for i in beautiful_list:
        try:
            if int(i[list_max]) == 1:
                count += 1
                temp.append(i)
        except:
            continue
    if count > int(nk[1]):
        beautiful_list = temp
        list_max += 1
    elif count == int(nk[1]):
        beautiful_list = temp
        num_count = True
        for num in beautiful_list:
            if num_count == True:
                ronriseki = int(num, 2)
            else:
                ronriseki = ronriseki & int(num, 2)
            num_count = False
        print(ronriseki)
        status = False
    elif list_max == -1:
        num_count = True
        for num in beautiful_list:
            if num_count == True:
                ronriseki = int(num, 2)
            else:
                ronriseki = ronriseki & int(num, 2)
            num_count = False
        print(ronriseki)
        status = False
    else:
        list_max += 1


### FIXED CODE ###

nk = input().split()
seisuuretu_2 = input().split()
nk1 = int(nk[1])

#seisuuretu = [int(i) for i in seisuuretu_2]
seisuuretu = list(map(int, seisuuretu_2))

list_max = set()
beautiful_list = []
for start in range(len(seisuuretu) + 1):
    for end in range(len(seisuuretu) + 1):
        if start < end:
            temp_pattern = bin(sum(seisuuretu[start:end]))[2:]
            beautiful_list.append(temp_pattern)
            list_max |= {len(temp_pattern),}

list_max = -max(list_max)

status = True
while status == True:
    temp = []
    count = 0
    for i in beautiful_list:
        try:
            if i[list_max] == "1":
                count += 1
                temp.append(i)
        except:
            continue
    if count > nk1:
        list_max += 1
        beautiful_list = temp
    elif count == nk1:
        num_count = True
        for num in temp:
            if num_count == True:
                ronriseki = int(num, 2)
            else:
                ronriseki = ronriseki & int(num, 2)
            num_count = False
        print(ronriseki)
        exit()
        status = False
    elif list_max == -1:
        num_count = True
        for num in beautiful_list:
            if num_count == True:
                ronriseki = int(num, 2)
            else:
                ronriseki = ronriseki & int(num, 2)
            num_count = False
        print(ronriseki)
        exit()
        status = False
    else:
        list_max += 1
### BUGGY CODE ###


N = int(input())
S = input()

total = 0

for i in range(N):
    to_E = S.count('W', 0, i)
    to_W = S.count('E', i + 1, N + 1)
    total_temp = to_E + to_W

    if i == 0:
        total = total_temp
    elif total_temp < total:
        total = total_temp

print(total)


### FIXED CODE ###


N = int(input())
S = input()

count_W = []
count = 0
for i in range(N):
    if i == 0:
        count_W.append(0)
    else:
        if S[i-1:i] == 'W':
            count += 1
        count_W.append(count)

count_E = []
for i in range(N):
    count_E.append(0)
count = 0
for i in range(N - 1, -1, -1):
    if S[i+1:i+2] == 'E':
        count += 1
    count_E[i] = count

total_list = []
for i in range(N):
    to_E = count_W[i]
    to_W = count_E[i]
    total_list.append(to_E + to_W)

print(min(total_list))
### BUGGY CODE ###

N, W = map(int, input().split())
WV = [list(map(int, input().split())) for _ in range(N)]

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

for i in range(1, N+1):
    weight = WV[i-1][0]
    value = WV[i-1][1]
    for w in range(W+1):
        if w-weight<0:
            dp[i][w] = dp[i-1][w]
        else:
            dp[i][w] = max(dp[i-1][w-weight]+value, dp[i-1][w])

print(dp[N][W])

### FIXED CODE ###

N, W = map(int, input().split())
WV = [list(map(int, input().split())) for _ in range(N)]

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

for i in range(1, N+1):
    weight = WV[i-1][0]
    value = WV[i-1][1]
    for w in range(W+1):
        if w-weight<0:
            dp[i][w] = dp[i-1][w]
        else:
            dp[i][w] = max(dp[i-1][w-weight]+value, dp[i-1][w])
print(dp[N][W])
### BUGGY CODE ###

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

def pascal(N,K):
  C=[[0 for i in range(K+1)]for j in range(N+1)]
  for i in range(N+1):
    for j in range(K+1):
      if i==j+1 or j==1:
        C[i][j]=i
      elif i==j or j==0:
        C[i][j]=1
      else:
        C[i][j] = C[i-1][j]+C[i-1][j-1]
  return C[N][K]
    
mod = 10**9+7
x=0
for i in range(1,K+1):
  x = pascal(N-K+1,i)*pascal(K-1,i-1)
  print(x%mod)

### FIXED CODE ###

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

mod = 10**9+7
n = N-K+1
print(n)
for i in range(2,K+1):
  n = n * (N-K+2-i)*(K+1-i)//(i*(i-1))
  print(n%mod)
### BUGGY CODE ###

n = int(input())
arr = []
for i in range(n):
    num = input()
    if num in arr:
        arr.remove(num)
    else:
        arr.append(num)
print(len(arr))


### FIXED CODE ###

n = int(input())
arr = set()
for i in range(n):
    num = int(input())
    if num in arr:
        arr.remove(num)
    else:
        arr.add(num)
print(len(arr))