Harryxun/stf_run huggingface dataset:
n = int(input())
X = [[int(i) for i in input().split()] for j in range(n)]

ans = 0

for x, u in X:
    if u == 'BTC':
        x *= 380000
    ans += x

print(ans)

### FIXED CODE ###

n = int(input())
X = [[i for i in input().split()] for j in range(n)]

ans = 0

for x, u in X:
    x = float(x)
    if u == 'BTC':
        x *= 380000
    ans += x

print(ans)
a = input()
b = input()
print a * b
print a * 2 + b * 2

### FIXED CODE ###


l = map(int, raw_input().split())
 
print "%d %d" % (l[0]*l[1], (l[0]+l[1])*2)
from functools import reduce
from fractions import gcd
n = int(input())
A = list(map(int,input().split()))
B = A.copy()
ans1 = reduce(gcd, A)
for i in range(n-1):
  A.pop(i)
  ans = reduce(gcd, A)
  A = B
  if ans > ans1: 
    print(ans)
    exit()
print(ans1)

### FIXED CODE ###

import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
left = [0] * (n + 1)
right = [0] * (n + 1)
for i in range(n):
    left[i + 1] = (fractions.gcd(left[i],a[i]))
    right[n - i - 1] = (fractions.gcd(right[n - i],a[n - 1 - i]))
ans = 0
for i in range(n):
    ans = max(ans,fractions.gcd(left[i],right[i + 1]))
print(ans)
import sys

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

graph_seed = list(map(int, input().split()))
graph = {}

for index, route in enumerate(graph_seed):
    index += 1
    graph[index] = route

queue = [1]
now_pos = 1

start = 0

for i in range(K):
    if not graph[now_pos] in queue:
        queue.append(graph[now_pos])
        now_pos = graph[now_pos]

    # 循環した
    else:
        start = graph[now_pos]
        break

before = queue[:queue.index(start)]
roop = queue[queue.index(start):]

for i in range(len(roop)):
    if (K - len(before)) % len(roop) == i:
        print(roop[i])
        sys.exit()


### FIXED CODE ###

import sys
import time

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

queue = {}

start = -1
count = 1

now_town = 1

for i in range(K):
    if town_list[now_town - 1] in queue:
        start = town_list[now_town - 1]
        break
    queue[town_list[now_town - 1]] = count
    now_town = town_list[now_town - 1]
    count += 1

if start == -1:
    print(now_town)
    sys.exit()

roop = len(queue) - (queue[start] - 1)
before_len = queue[start]

print(list(queue.keys())[(K - before_len) % roop + before_len - 1])
#MLE注意！0や1のケースに注意

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math
    #from math import gcd

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    a = list(map(int, input().split()))
    res = 0
    l = [0]*(10**6)
    used = []
    for i in range(n):
        if a[i] >= n:
            continue
        l[i+1-a[i]] += 1
        used.append(i+1-a[i])
    for i in range(n):
        if a[i] >= n:
            continue
        l[used[i]] -= 1
        b = i+1+a[i]
        res += l[b]
    print(res)



if __name__ == '__main__':
    main()

### FIXED CODE ###

#MLE注意！0や1のケースに注意

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math
    #from math import gcd

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    a = list(map(int, input().split()))
    res = 0
    l = [0]*(10**6)
    used = []
    for i in range(n):
        if 0<=i+1-a[i]<n:
            l[i+1-a[i]] += 1
            used.append(i+1-a[i])
    cnt = 0
    for i in range(n):
        if 0<=i+1-a[i]<n:
            l[used[cnt]] -= 1
            cnt += 1
        if 0<=i+1+a[i]<10**6:
            b = i+1+a[i]
            res += l[b]
    print(res)



if __name__ == '__main__':
    main()
import statistics
import copy

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

for i in range(len(X)):
    A = copy.deepcopy(X)
    del A[i]
    print(statistics.median(A))


### FIXED CODE ###

import statistics as sta

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

sort_X = sorted(X)
a = sta.median_low(sort_X)
b = sta.median_high(sort_X)

for i in range(N):
    if X[i] <= a:
        print(b)
    else:
        print(a)
def main():
    n = int(input())
    lst = list(map(int, input().split()))

    print(min(numlst), max(numlst), sum(numlst))

if __name__ == '__main__':
    main()



### FIXED CODE ###

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

minX = min(X)
maxX = max(X)
sumX = sum(X)
print(minX, maxX, sumX)
N = int(input())
S = list(map(str, input()))
f=0
i_c = j_c = k_c =1
ijk = list()
for i in range(N):
    for j in range(N):
        for k in range(N):
            if(k_c>j_c and j_c>i_c):
                if(j_c-i_c!=k_c-j_c):
                    ijk.append([i,j,k])
            k_c+=1
        j_c+=1
        k_c = 1
    i_c+=1
    j_c = 1
S_i = ijk[i][0]
S_j = ijk[i][1]
S_k = ijk[i][2]
for i in range(len(ijk)):
    if(S[ijk[i][0]]!= S[ijk[i][1]] and
       S[ijk[i][0]]!= S[ijk[i][2]] and
       S[ijk[i][1]]!= S[ijk[i][2]]):
       f+=1
print(f)

### FIXED CODE ###

n=int(input())
s=input()
r=g=b=0
for i in s:
  if i=="R":r+=1
  elif i=="G":g+=1
  else:b+=1

ans=r*g*b
for i in range(n):
  for j in range(i+1,n):
    k_ = j+(j-i)
    if(k_ >=n):
      break
    ans -= int(s[i]!= s[j] and s[i] != s[k_] and s[j] != s[k_])

print(ans)
N = int(input()) 
s = list(map(int, input().split()))
A = 0
for i in range (N):
  if s[i] == i:
    continue
  else:
    A+=1
if A <= 2 or:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

A, B = map(int, input().split())
if A == 0 or B == 0 or (A + B)%2 ==1:
	print('IMPOSSIBLE')
else:
  print(int((A + B)/2))
import bisect
import sys
input = sys.stdin.readline
a, b, q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(a)] + [INF]
t = [-INF] + [int(input()) for i in range(b)] + [INF]
ans = []
for i in range(q):
    x = int(input())
    idxs = bisect.bisect(s, x)
    idxt = bisect.bisect(t, x)
    ans.append(min(x - min(s[idxs - 1], t[idxt -1]),
                     x - s[idxs - 1] + (t[idxt] - s[idxs - 1]),
                     t[idxt] - x + (t[idxt] - s[idxs - 1]),
                     x - t[idxt - 1] + (s[idxs] - t[idxt - 1]),
                     s[idxs] - x + (s[idxs] - t[idxt - 1]),
                     max(s[idxs], t[idxt]) - x,
                     min(x - min(s[idxs - 1], t[idxt -1]))))
for i in range(q):
    print(ans[i])





### FIXED CODE ###

import bisect

a, b, q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(a)] + [INF]
t = [-INF] + [int(input()) for i in range(b)] + [INF]
ans = []
for i in range(q):
    x = int(input())
    idxs = bisect.bisect(s, x)
    idxt = bisect.bisect(t, x)
    lis = []
    lis.append(x - min(s[idxs - 1], t[idxt -1]))
    lis.append(x - s[idxs - 1] + (t[idxt] - s[idxs - 1]))
    lis.append(t[idxt] - x + (t[idxt] - s[idxs - 1]))
    lis.append(x - t[idxt - 1] + (s[idxs] - t[idxt - 1]))
    lis.append(s[idxs] - x + (s[idxs] - t[idxt - 1]))
    lis.append(max(s[idxs], t[idxt]) - x)
    ans.append(min(lis))
for i in range(q):
    print(ans[i])
N, M  = map(int,input().split())
s = [-1]*M
c = [-1]*M
for i in range(M):
  s[i],c[i] = map(int,input().split())
if N==1 and s[0]==1 and c[0]==0:
  print(0)
  exit()
arr_ans = [-1]*(N+1)
for i in range(M):
  if arr_ans[s[i]] == -1 or arr_ans[s[i]] == c[i]:
    arr_ans[s[i]] = c[i]
  else:
    print(-1)
    exit()
    
if arr_ans[1] == 0:
  print(-1)
  exit()
for i in range(1,N+1):
  if arr_ans[i] == -1:
    if i == 1:
      arr_ans[i] = 1
    else:
      arr_ans[i] = 0

_ans = [str(arr_ans[i]) for i in range(N+1)]
ans = ''.join(_ans[1:])
print(ans)
  

### FIXED CODE ###

N, M  = map(int,input().split())
s = [-1]*M
c = [-1]*M
for i in range(M):
  s[i],c[i] = map(int,input().split())
if N==1 and M==0:
  print(0)
  exit()
if N==1 and s[0]==1 and c[0]==0:
  print(0)
  exit()
arr_ans = [-1]*(N+1)
for i in range(M):
  if arr_ans[s[i]] == -1 or arr_ans[s[i]] == c[i]:
    arr_ans[s[i]] = c[i]
  else:
    print(-1)
    exit()
    
if arr_ans[1] == 0:
  print(-1)
  exit()
for i in range(1,N+1):
  if arr_ans[i] == -1:
    if i == 1:
      arr_ans[i] = 1
    else:
      arr_ans[i] = 0

_ans = [str(arr_ans[i]) for i in range(N+1)]
ans = ''.join(_ans[1:])
print(ans)
import sys
input = sys.stdin.buffer.readline
 
def main():
    t,b,c,d = map(int,input().split())
    MOD = 10**9+7
    N = c+d+5
    fac = [0 for _ in range(N+1)]
    fac[0],fac[1] = 1,1
 
    for i in range(2,N+1):
        fac[i] = (fac[i-1]*i)%MOD
        
    def comb(x,y):
        return (fac[x+y]*pow(fac[x],MOD-2,MOD)*pow(fac[y],MOD-2,MOD))%MOD
 
    print((comb(c+1,d+1)-comb(c+1,b)-comb(d+1,t)+comb(t,b))%MOD)
    
if _name_ == "_main_":
    main()
#print the result

### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline
 
def main():
    a,b,p,d = map(int,input().split())
    MOD = 10**9+7
    N = p+d+5
    fac = [0 for _ in range(N+1)]
    fac[0],fac[1] = 1,1
 
    for i in range(2,N+1):
        fac[i] = (fac[i-1]*i)%MOD
        
    def comb(x,y):
        return (fac[x+y]*pow(fac[x],MOD-2,MOD)*pow(fac[y],MOD-2,MOD))%MOD
 
    print((comb(p+1,d+1)-comb(p+1,b)-comb(d+1,a)+comb(a,b))%MOD)
    
if __name__ == "__main__":
    main()
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    n = int(input())
    counter = [[0] * 16 for _ in range(24)] # -9 ~ 13, -9 ~ 5
    ans = 0
    for _ in range(n):
        S = input()
        if '.' in S:
            a, b = S.split('.')
            two = five = -len(b)
            a = int(a + b)
        else:
            two = five = 0
            a = int(S)
        while a % 2 == 0:
            two += 1
            a //= 2
        while a % 5 == 0:
            five += 1
            a //= 5
        for i in range(-9, 14):
            for j in range(-9, 6):
                if two + i >= 0 and five + j >= 0:
                    ans += counter[i][j]
        counter[two][five] += 1
    print(ans)
resolve()

### FIXED CODE ###

import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
from collections import Counter
def resolve():
    n = int(input())
    C = Counter()
    for _ in range(n):
        S = input()
        if '.' in S:
            a, b = S.split('.')
            a = int(a + b + '0' * (9 - len(b)))
        else:
            a = int(S + '0' * 9)
        two = five = 0
        while a % 2 == 0:
            two += 1
            a //= 2
        while a % 5 == 0:
            five += 1
            a //= 5
        C[two, five] += 1

    ans = 0
    for key0, val0 in C.items():
        i0, j0 = key0
        for key1, val1 in C.items():
            i1, j1 = key1
            if i0 + i1 >= 18 and j0 + j1 >= 18:
                if key0 == key1:
                    ans += val0 * (val0 - 1) // 2
                elif key0 < key1:
                    ans += val0 * val1
    print(ans)
resolve()
a,b,c,d,e,f = map(int,input().split())


from itertools import product
water = set()

for i,j in product(range(f//(a*100)+1),range(f//(100*b)+1)):
  n = a*i+b*j
  if n <= f:
    water.add(n)

water = sorted(water)

salt = set()

for i,j in product(range(f//c+1),range(f//d+1)):
  n = c*i+d*j
  if n <= f:
    salt.add(n)

from bisect import bisect_left

bs,bw = 0,1
salt = sorted(salt)
for s in salt:
  w = s/e
  i = bisect_left(water,w)
  w = water[i]
  if 100*w + s > f:
    break
  if bs*w < bw*s:
    bs,bw = s,w

print(bs+100*bw,bs)


### FIXED CODE ###

a,b,c,d,e,f = map(int,input().split())


from itertools import product
water = set()

for i,j in product(range(f//(a*100)+2),range(f//(100*b)+2)):
  n = a*i+b*j
  if n <= f:
    water.add(n)

water = sorted(water)

salt = set()

for i,j in product(range(f//c+2),range(f//d+2)):
  n = c*i+d*j
  if n <= f:
    salt.add(n)

salt = sorted(salt)

from bisect import bisect_left



bs,bw = 0,min(a,b)
for s in salt:
  w = s/e
  i = bisect_left(water,w)
  if i >= len(water):
    break
  w = water[i]
  if 100*w + s > f:
    break
  if bs*w < bw*s:
    bs,bw = s,w

print(bs+100*bw,bs)
N=int(input())
L=list(map(int, input().split()))
L.sort()
L.reverse()
a=L.pop(0)
count=0
while(L!=[]):
    for i in range(len(L)):
        for j in range(i+1,len(L)):
            if a < L[i]+L[j]:
                count+=1
    a=L.pop(0)
print(count)

### FIXED CODE ###

A,B=map(int, input().split())
print(A-2*B if A > 2*B else 0)
1print('ABC' if input()=='ARC' else 'ARC')

### FIXED CODE ###

print('ABC' if input()=='ARC' else 'ARC')
a = int(input())
b = input()
c = input()
d = input()
e = input()
k = int(input())
if e - a <= k:
    print("Yey!")
else:
    print(":(")

### FIXED CODE ###

a = int(input())
b = input()
c = input()
d = input()
e = int(input())
k = int(input())
if e - a <= k:
    print("Yay!")
else:
    print(":(")
a, b=input().split()
if a=='H':
  print('H')
else:
  if b=='D'
    print('H')
  else:
    print('D')

### FIXED CODE ###

a, b=input().split()
if a=='H':
  print(b)
else:
  if b=='D':
    print('H')
  else:
    print('D')
import itertools as itl
n, m=map(int, input().split())
#ここでリストを作成する
hen=[]
check=0
for _ in range(m):
  hen.append(tuple(map(int, input().split())))
#print(hen)
l=list(range(2, n+1))
for v in itl.permutations(l):
  #print(v)
  for i in range(n-2):
    if not(tuple(sorted(v[i:i+2])) in hen) or not(tuple([1, v[0]]) in hen):
      break
  else:
    if i==n-3:
      check+=1
    continue
    break 
print(check)
  
  
      
    

### FIXED CODE ###

import itertools as itl
n, m=map(int, input().split())
#ここでリストを作成する
hen=[]
check=0

for _ in range(m):
  hen.append(list(map(int, input().split())))
#print(hen)
l=list(range(2, n+1))
for v in itl.permutations(l):
  #print(v)
  for i in range(n-2):
    if not(sorted(v[i:i+2]) in hen) or not(list([1, v[0]]) in hen):
      break
  else:
    if n==2:
      check+=1
    elif i==n-3:
      check+=1
    continue
print(check)
# https://abc089.contest.atcoder.jp/tasks/abc089_c

import copy

n = int(input())
s = [input().replace("\n", "") for i in range(n)]
march_num_list = [0, 0, 0, 0, 0]

for name in s:
    for i, head in enumerate(("M", "A", "R", "C", "H")):
        if name[0] == head:
            march_num_list[i] += 1

pattern_num = 0

for i in range(len(march_num_list)):
    two_list = copy.copy(march_num_list)
    two_list.pop(i)
    for j in range(len(two_list)):
        three_list = copy.copy(two_list)
        three_list.pop(j)
        for k in range(len(three_list)):
            pattern_num += 1

print(pattern_num)

### FIXED CODE ###

n = int(input())

print(n//3)
import sys
import math
import itertools
import collections
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()

NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()

def main():
    N = NI()
    XL = [NLI() for _ in range(N)]
    

    arm_range = []
    for n in range(N):
        arm_len = XL[1]
        arm_range.append([XL[n][0]-XL[n][1],XL[n][0]+XL[n][1]])

    
    sorted_arm_range = sorted(arm_range, key=lambda x: x[1])  #[1]に注目してソート

    
    x = 0
    ans = 1
    while x<N-1:
        arm_end = sorted_arm_range[x][1]
        while x<N-1 and sorted_arm_range[x+1][0] < arm_end:
            x += 1
        ans += 1
        x += 1
        
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
import math
import itertools
import collections
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()

NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()

def main():
    N = NI()
    XL = [NLI() for _ in range(N)]
    
    #print(XL)
    arm_range = []
    for n in range(N):
        arm_range.append([XL[n][0]-XL[n][1],XL[n][0]+XL[n][1]])
    #print(arm_range)
    
    sorted_arm_range = sorted(arm_range, key=lambda x: x[1])  #[1]に注目してソート
    #print(sorted_arm_range)
    
    ans = 1
    arm_end = sorted_arm_range[0][1]
    
    if N == 1:
        ans = 1
    else:
        for n in range(N-1):
            if sorted_arm_range[n+1][0] >= arm_end:
                arm_end = sorted_arm_range[n+1][1]
                ans += 1

    print(ans)

if __name__ == '__main__':
    main()
import sys


def parallelism(x1, y1, x2, y2, x3, y3, x4, y4):
    if x2 - x1 == 0.0 or x4 - x3 == 0.0:
        return x2 - x1 == 0.0 and x4 - x3 == 0.0
    else:
        return ((y2 - y1) / (x2 - x1)) == ((y4 - y3) / (x4 - x3))


lines = sys.stdin.readlines()
lines.pop(0)

for line in lines:
    x1, y1, x2, y2, x3, y3, x4, y4 = tuple(map(float, line.split(' ')))
    if parallelism(x1, y1, x2, y2, x3, y3, x4, y4):
        print "YES"
    else:
        print "NO"

### FIXED CODE ###


import sys


def parallelism(x1, y1, x2, y2, x3, y3, x4, y4):
    if x2 - x1 == 0.0 or x4 - x3 == 0.0:
        return x2 - x1 == 0.0 and x4 - x3 == 0.0
    else:
        return ((y2 - y1) / (x2 - x1)) == ((y4 - y3) / (x4 - x3))


#lines = sys.stdin.readlines()
#lines.pop(0)

for i in range(input()):
    x1, y1, x2, y2, x3, y3, x4, y4 = tuple(map(float, raw_input().split(' ')))
    if parallelism(x1, y1, x2, y2, x3, y3, x4, y4):
        print "YES"
    else:
        print "NO"
def main():
    H, W = map(int, input().split())
    A = [list(map(int, input().split())) for h in range(H)]
    cnt = 0
    out = []
    for h in range(H):
        for w in range(W):
            if A[h, w]%2 == 1:
                cnt += 1
                if w < W-1:
                    A[h, w+1] += 1
                    out.append(list(map(str, [h+1, w+1, h+1, w+2])))
                elif h < H-1:
                    A[h+1, w] += 1
                    out.append(list(map(str, [h+1, w+1, h+2, w+1])))
                else:
                    cnt -= 1
    print(cnt)
    for posi in out:
        print(" ".join(posi))


if __name__ == '__main__':
    main()


### FIXED CODE ###

H, W = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(H)]
ans = []

for h in range(H-1):
	for w in range(W-1):
		if a[h][w] % 2 == 1:
			ans.append([h+1, w+1, h+1, w+2])
			a[h][w+1] += 1
	if a[h][-1] % 2 == 1:
		ans.append([h+1, W, h+2, W])
		a[h+1][-1] += 1

for w in range(W-1):
	if a[H-1][w] % 2 == 1:
		ans.append([H, w+1, H, w+2])
		a[H-1][w+1] += 1

print(len(ans))
for an in ans:
	print(*an)
H, W = map(int, input().split())
mat = [input() for i in range(W)]
mat_t = [''.join(x) for x in zip(*mat)]
def check(mat, t):
    stack = set()
    for i, string in enumerate(mat):
        string = '.' + string + '.'
        for j in range(len(string)):
            if j+3<=len(string):
                if string[j:j+3] == '.#.':
                    if t==False:
                        stack.add((i, j))
                    else:
                        stack.add((j, i))
    return stack

stack1 = check(mat, False)
stack2 = check(mat_t, True)
if stack1 & stack2:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

H, W = map(int, input().split())
mat = [input() for i in range(H)]
mat_t = [''.join(x) for x in zip(*mat)]
def check(mat, t):
    stack = set()
    for i, string in enumerate(mat):
        string = '.' + string + '.'
        for j in range(len(string)):
            if j+3<=len(string):
                if string[j:j+3] == '.#.':
                    if t==False:
                        stack.add((i, j))
                    else:
                        stack.add((j, i))
    return stack

stack1 = check(mat, False)
stack2 = check(mat_t, True)
if stack1 & stack2:
    print('No')
else:
    print('Yes')
i = list(map(int,input().split()))
A = i[0]
B = i[1]
if A>12:
  print(B)
  elif A<6:
    print(0)
    else:
      print(B/2)
      

### FIXED CODE ###

A,B = map(int,input().split())
if A<6:
  print(0)
elif A<13:
  print(B//2)
else:
  print(B)
A,B,X=map(int,input().split())
if A<=X<=A+B:
    print(YES)
else:
    print(NO)

### FIXED CODE ###

A,B,X=map(int,input().split())
if A<=X<=A+B:
    print('YES')
else:
    print('NO')
from collections import Counter
N,K=map(int,input().split())
A=list(map(int,input().split()))
x=Counter(A)
l=x.most_common(K)
s=0
for i in range(K):
  s+=l[i][1]
  
print(N-s)

### FIXED CODE ###

from collections import Counter
N,K=map(int,input().split())
A=list(map(int,input().split()))
x=Counter(A)
l=x.most_common(K)
s=0
for i in range(len(l)):
  s+=l[i][1]
  
print(N-s)
import sys
input=sys.stdin.readline

n=int(input())
a=list(map(int,input().split()))
b=[0]*n
if n==1:
    b=a
elif n==2:
    b[1]=a[1]
    b[0]=(a[0]-b[1])%2
elif n==3:
    b[1]=a[1]
    b[2]=a[2]
    b[0]=(a[0]-b[1]-b[2])%2
i=2
while n/i>=2:
    for k in range(n//i,n//(i-1)):
        j=2
        b[k]=a[k]
        while j*(k+1)-1<n:
            b[k]=(b[k]-b[j*(k+1)-1])%2
            j+=1
    i+=1
j=1
b[1]=a[1]
b[0]=a[0]
while j*1<n:
    if 1+j*2<n:
        b[1]=(b[1]-b[1+j*2])%2
    b[0]=(b[0]-b[j*1])%2
    j+=1
num=0
for i in range(n):
    if b[i]==1:
        print(i+1)
        num+=1
if num==0:
  print(0)
    

### FIXED CODE ###

import sys
input=sys.stdin.readline

n=int(input())
a=list(map(int,input().split()))
b=[0]*n
if n==1:
    b=a
elif n==2:
    b[1]=a[1]
    b[0]=(a[0]-b[1])%2
    
elif n==3:
    b[1]=a[1]
    b[2]=a[2]
    b[0]=(a[0]-b[1]-b[2])%2
else:
  i=2
  while n/i>=1:
      for k in range((n//i)+1,n//(i-1)+1):
          j=2
          b[k-1]=a[k-1]
          while j*k-1<n:
              b[k-1]=(b[k-1]-b[j*k-1])%2
              j+=1
      i+=1
  j=1
  b[0]=a[0]
  while j*1<n:
      b[0]=(b[0]-b[j*1])%2
      j+=1
num=sum(b)
print(num)
for i in range(n):
    if b[i]==1:
        print(i+1)
S = input()
g=input()
f = list(g)
print(f)
h =set(f)
k = list(h)
if len(k)==1:
  print('Yes')
else :
  print('No')

### FIXED CODE ###

g=input()
f = list(g)
h =set(f)
k = list(h)
if len(h)==1:
  print('No')
else :  
  print('Yes')
S=input()
n=len(S)-1
ans=0
def dfs(i,f):
  if i==n:
    return sum(map(int,f.split("+")))
  return dfs(i+1,f)+dfs(i+1,f+"+"+S[i+1])
print(dfs(0,S[0])  
    


### FIXED CODE ###

S=input()
n=len(S)
ans=0

for bit in range(1<<(n-1)):
  f=S[0]
  for i in range(n-1):
    if bit & (1<<i):
      f+="+"
    f+=S[i+1]
  ans+=sum(map(int,f.split("+")))
print(ans)
#import sys
print("hoge")
  ``` 
if __name__ == "__main__":
  args = sys.argv
  print(args)

  num = args[0]
  slimes = args[1]

  tmp = []
  for i in range(0,len(smiles)):
    if len(tmp): 
      if slimes[i] == slimes[i+1] and slimes[i] != tmp[-1]:
          tmp.append(slimes[i])
    else:
      if slimes[i] == slimes[i+1]:
          tmp.append(slimes[i])

  print(len(tmp))    
  ```


### FIXED CODE ###

if __name__ == "__main__":
  num = input()
  slimes = input()

  tmp = []
  for i in range(0,len(slimes)):
    if len(tmp):
      if slimes[i] != tmp[-1]:
          tmp.append(slimes[i])
    else:
      tmp.append(slimes[i])
  print(len(tmp))
h,n = map(int,input().split())
a = int().rstrip().split()
c = 0
for b in a:
  c += b
if h > c:
  print('No')
else:
  print('Yes')

### FIXED CODE ###

h,n = map(int,input().split())
z = input()
a = z.split()
c = 0
for b in a:
  c += int(b)
if h > c:
  print('No')
else:
  print('Yes')
a = input()

count = 0

if a[1:2] = "1":
  count += 1

if a[2:3] = "1":
  count += 1

if a[3:4] = "1":
  count += 1

print(count)

### FIXED CODE ###

a = input()
b = int(a[0:1])
c = int(a[1:2])
d = int(a[2:3])

ball = 0

if(b == 1):
  ball += 1

if(c == 1):
  ball += 1

if(d == 1):
  ball += 1
  
print(ball)