Harryxun/stf_run huggingface dataset:
n = int(input())
s = input()

r = s.count('R')
g = s.count('G')
b = s.count('B')

ans = r * g * b

for i in range(n):
    for d in range(1, n):
        j = i + d
        k = j + d
        if k > n:
            break
        if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
            ans -= 1

print(ans)

### FIXED CODE ###

n = int(input())
s = input()

r = s.count('R')
g = s.count('G')
b = s.count('B')

ans = r * g * b

for i in range(n):
    for d in range(1, n):
        j = i + d
        k = j + d
        if k >= n:
            break
        if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
            ans -= 1

print(ans)
# 1. 最大公約数を求める(ユークリッドの互除法)
# 2. 最大公約数を素因数分解する。
# 3. 2.の結果に含まれる素数を２つのグループに分ける

import itertools

def main():
  a, b = map(int, input().split())
  c = gojo(a,b)
  
  fac = [1]
  fac = facto(c, fac)
  #print(fac)
  print(len(fac))  
  
def facto(n, fac):
  if n == 1:
    return [1]
  if n == 2:
    return[1, 2]
  if n % 2 == 0:
    fac = [1, 2]
  else:
    fac = [1]
  
  max_n = int(n + 1) ** 0.5 + 2
  is_prime = [True for x in range(max_n)]
  for cursor in range(3, max_n, 2):
    if is_prime[cursor]:
      if n % cursor == 0:
        fac.apppend(cursor)
        n = n // cursor
        if n == 1:
          break
      for i in range(cursor, max_n, 2):
        is_prime[i] = False
        
    if len(fac) == 1:
      fac = [1, n]
      
  return fac
  
def gojo(a,b):
  if b > a:
    a, b = b, a
  c = a % b
  if c == 0:
    return(b)
  else:
    return gojo(b, c)

if __name__ == "__main__":
  main()


### FIXED CODE ###

# 1. 最大公約数を求める(ユークリッドの互除法)
# 2. 最大公約数を素因数分解する。
# 3. 2.の結果に含まれる素数＋１が答え

import itertools
from fractions import gcd
from math import ceil

def main():
  a, b = map(int, input().split())
  fac = facto(gcd(a,b))
  print(len(fac))  
  
def facto(n):
  fac = [1]
  if n == 1:
    return [1]
  elif n % 2 == 0:
    fac = [1, 2]
    while n % 2 == 0:
      n = n // 2
  
  max_n = ceil(n ** 0.5) + 1
  
  is_prime = [True for x in range(max_n)]
  for cursor in range(3, max_n, 2):
    if is_prime[cursor]:
      if n % cursor == 0:
        fac.append(cursor)
        while n % cursor == 0:
          n = n // cursor
        if n == 1:
          break
      for i in range(cursor, max_n, cursor):
        is_prime[i] = False
  if n != 1:
    fac.append(n)
  return fac

if __name__ == "__main__":
  main()
N, _ = map(int, input().strip().split())
D = input().strip().split()
for ans in range(N, 100000):
    if len(set(str(ans)) & set(D)) == 0:
        print(ans)
        break

### FIXED CODE ###

l = list(map(int, input().split()))
if (l.count(5) == 2) and (l.count(7) == 1):
    print('YES')
else:
    print('NO')
import math
a = int(input())
flag = False
i = 0

while i <= math.sqrt(a):
  b = divmod(a)
  if b[0] < 10 and b[1] == 0:
    flag = True
  else:
    i+=1
    
if flag:
  print("Yes")
else:
  print("No")



### FIXED CODE ###

import math
a = int(input())
flag = False
i = 1

while i <= math.sqrt(a):
  b = divmod(a,i)
  if b[0] < 10 and b[1] == 0:
    flag = True
  i+=1
    
if flag:
  print("Yes")
else:
  print("No")
from math import gcd
from functools import reduce
def lcm_base(x,y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
    
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
    
N = int(input())
a = [int(i) for i in input().split(" ")]

x = lcm_list(a)-1
Sum = 0
for a_ in a:
    Sum += x%a_
print(Sum)

### FIXED CODE ###

from fractions import gcd
from functools import reduce
def lcm_base(x,y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
    
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
    
N = int(input())
a = [int(i) for i in input().split(" ")]

x = lcm_list(a)-1
Sum = 0
for a_ in a:
    Sum += x%a_
print(Sum)
a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
  temp = []
  for j in range(5):
    d = 10**(4-i)
    p = i//d
    temp.append(p)
    i -= p*d
  if temp[0] == temp[4] and temp[1] == temp[3]:
    ans += 1
print(ans)

### FIXED CODE ###

a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
  temp = []
  for j in range(5):
    d = 10**(4-j)
    p = i//d
    temp.append(p)
    i -= p*d
  if temp[0] == temp[4] and temp[1] == temp[3]:
    ans += 1
print(ans)
from collections import defaultdict
n = int(input())
li = []
for i in range(n):
    xi,yi = map(int,input().split())
    li.append((xi,yi))
dic = defaultdict(int)
for i in range(n):
    for j in range(n):
        if i != j:
            xi = li[i][0]
            yi = li[i][1]
            xj = li[j][0]
            yj = li[j][1]
            dic[(xi-xj,yi-yj)] += 1
print(n-max(dic.values()))

### FIXED CODE ###

from collections import defaultdict
n = int(input())
li = []
for i in range(n):
    xi,yi = map(int,input().split())
    li.append((xi,yi))
if n == 1:
    print(1)
    exit()
dic = defaultdict(int)
for i in range(n):
    for j in range(n):
        if i != j:
            xi = li[i][0]
            yi = li[i][1]
            xj = li[j][0]
            yj = li[j][1]
            dic[(xi-xj,yi-yj)] += 1
print(n-max(dic.values()))
n = int(input())
s = input()
s_list = list(s)
count = 0
for i in range(n):
    while s_list[i] != s_list[i+1]:
        count += 1
output = count+1
print(output)

### FIXED CODE ###

n = int(input())
s_list = list(input())
count = 0
for i in range(n-1):
    if s_list[i] != s_list[i+1]:
        count += 1
output = count+1
print(output)
n = int(input())

a = [int(x) for x in input().split()]

a.sort()
if a[0]==a[1]:
	ans=0
else:
	ans=1

for i in range(0,len(a)):
	for j in range(len(a)):
		if a[i]%a[j]==0:
			break
		if j==i-1:
			ans+=1
			break

print(ans)


### FIXED CODE ###

n = int(input())

a = [int(x) for x in input().split()]

baisuu=[0]*(10**6+1)

for i in a:
	if baisuu[i]>=1:
		baisuu[i]=2
		continue

	for j in range(i,10**6+1,i):
		baisuu[j]+=1

ans=0

for i in a:
	if baisuu[i]==1:
		ans+=1

print(ans)
n = int(input())
text = input(list()            # テキストをリストに変換
pattern = list('ABC')          # パターンをリストに変換


for i in range(n):
    match = True                # 一致しているものとして探索開始
    for j in range(len(pattern)):
        if text[i + j] != pattern[j]:
            match = False       # 一致しなかった
            break
    if match:                   # すべての文字が一致していれば出力
        print(i)
        break

### FIXED CODE ###

n = int(input())
s = input()      
pattern = list('ABC')          
cnt = 0

for i in range(n-len(pattern)+1):
    if s[i] == pattern[0]:
        if s[i+1] == pattern[1]:
            if s[i+2] == pattern[2]:
                cnt += 1

print(cnt)
N, M = map(int, raw_input().split())

for i in reversed(range(1, M/N+1)):
    if M % i == 0:
        print i
        exit()


### FIXED CODE ###

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

output = 1
for i in range(M//N, 0, -1):
    if M % i == 0 and output < i:
        output = i
        break
print(output)
n, m = map(int, input().split())
uv = [list(map(int, input().split())) for _ im range(m)]
alist = [[] for _ in range(n)]
for u, v in uv:
    alist[u].append(v)
s, t = map(int, input().split())

alist3 = [set([]) for _ in range(n)]
for u, v in uv:
for v in range(n):
    for v1 in alist[v]:
        for v2 in alist[v1]:
            for v3 in alist[v2]:
                alist3[v].add(v2)

# BFS
queue = [s]
visited = [-1]*n
visited[s] = 0
while len(queue) > 0:
    q = queue.pop(0)
    for v in alist3[q]:
        if visited[v] >= 0:
            queue.append(v)
            visited[v] = visited[q] + 1
print(visited[t])




### FIXED CODE ###

n, m = map(int, input().split())
uv = [list(map(int, input().split())) for _ in range(m)]
s, t = map(int, input().split())

alist = [[] for _ in range(3*n)]
for u, v in uv:
    u, v = u-1, v-1
    alist[u].append(n+v)
    alist[n+u].append(2*n+v)
    alist[2*n+u].append(v)


# BFS
queue = [s-1]
visited = [-3]*(3*n)
visited[s-1] = 0
while len(queue) > 0:
    q = queue.pop(0)
    for v in alist[q]:
        if visited[v] < 0:
            queue.append(v)
            visited[v] = visited[q] + 1
print(visited[t-1]//3)
from bisect import bisect_left

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

l.sort()
count = 0
for i in range(n-2):
  for j in range(i+1,n-1):
    print(bisect_left(l,l[j]+l[i]),i,j,l)
    count+=bisect_left(l,l[j]+l[i])-j-1
print(count)

### FIXED CODE ###

from bisect import bisect_left

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

l.sort()
count = 0
for i in range(n-2):
  for j in range(i+1,n-1):
    count+=bisect_left(l,l[j]+l[i])-j-1
print(count)
A, B = map(int(input()))
if (A+B) % 2 == 0:
  print((A+B)//2)
else:
  print('IMPOSSIBLE')

### FIXED CODE ###

A, B = map(int,input().split())
if (A+B) % 2 == 0:
    print((A+B)//2)
else:
    print('IMPOSSIBLE')
from collections import deque
import copy

def main():
    h,w = map(int, input().split())
    a = [[j == "#" for j in input()] for _ in range(h)]
    # dy = [1,-1,0,0]
    # dx = [0,0,1,-1]
    que = deque([(i, j) for i in range(h) for j in range(w) if a[i][j]])

    count = 0
    while True:
        count += 1
        nque = deque()
        while que:
            y,x = que.popleft()
            if x >0 and not a[y][x-1]:
                a[y][x-1] = True
                nque.append([y,x-1])
            if x <w-1 and not field[y][x+1]:
                a[y][x+1] = True
                nque.append([y,x+1])
            if y >0 and not a[y-1][x]:
                a[y-1][x] = True
                nque.append([y-1,x])
            if y < h-1 and not a[y+1][x]:
                a[y+1][x] = True
                nque.append([y+1,x])
            # for i in range(4):
            #     nh = h + dy[i]
            #     nw = w + dx[i]
            #     if (0<=nh<H) and (0<=nw<W):
            #         if field[nh][nw] == False:
            #             field[nh][nw] = True
            #             nqueue.append((nh,nw))
        if nque:
            que = copy.copy(nque)
        else:
            break
    print(count-1)
if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import deque
import copy

def main():
    h, w = map(int, input().split())
    a = [[j == "#" for j in input()] for _ in range(h)]


    # スタート地点をqueueに追加
    que = deque([(i, j) for i in range(h) for j in range(w) if a[i][j]])

    count = 0
    while True:
        count += 1
        nque = deque()
        while que:
            y, x = que.popleft()
            if x > 0 and not a[y][x-1]:
                a[y][x-1] = True
                nque.append((y,x-1))
            if x < w-1 and not a[y][x+1]:
                a[y][x+1] = True
                nque.append((y,x+1))
            if y > 0 and not a[y-1][x]:
                a[y-1][x] = True
                nque.append((y-1,x))
            if y < h-1 and not a[y+1][x]:
                a[y+1][x] = True
                nque.append((y+1,x))

        if nque:
            que = copy.copy(nque)
        else:
            break

    print(count - 1)

if __name__ == '__main__':
    main()
h,w,a,b=list(map(int,input().split())

for i in range(1,h+1):
    if i<=b:
        s="1"*a+"0"*(w-a)
    else:
        s="0"*a+"1"*(w-a)
    print(s)




### FIXED CODE ###


h,w,a,b=list(map(int,input().split()))

ans=""

for i in range(1,h+1):
    if i<=b:
        s="1"*a+"0"*(w-a)
    else:
        s="0"*a+"1"*(w-a)
    ans+=s+"\n"
print(ans)
N = int(input())
W = [input() for _ in range(N)]
Ws =[]
ans = 'Yes'

for i in range(N):
    Ws.append(W[i])
    for j in range(1,N+1)
        if W[i][-1] == W[j][0]:
            break
        else:
            ans = 'No'
            break
        
#print(Ws)

if len(set(W)) != len(Ws):
    ans = 'No'
print(ans)  

### FIXED CODE ###

N = int(input())
W = [input() for _ in range(N)]
ans = "Yes"

for i in range(N-1):
    if W[i][-1] != W[i+1][0] or W.count(W[i]) != 1:
        ans = "No"

print(ans)
def newrating(r , g):

    return (r + g) / 2

def main():
    r , g = map(int , input().split())
    print(newrating(r , g))

if __name__ == '__main__':
    main()

### FIXED CODE ###

def newrating(r , g):

    return (g - r) + g

def main():
    r = int(input())
    g = int(input())
    print(newrating(r , g))

if __name__ == '__main__':
    main()
dat =list(input().split())

for i in dat:
   i = int(i)

dat.sort()
dat.reverse()

asum = 0
bsum = 0

for i in range(len(dat)):
      if i%2==0:
          asum = asum + dat[i]
      else:
          bsum = bsum + dat[i]
		
print(asum-bsum)

### FIXED CODE ###

n = int(input())
dat = list(input().split())

dat = list(map(int,dat))

dat.sort(reverse=True)

asum = 0
bsum = 0

for i in range(n):
	if i % 2 == 0:
		asum = asum + dat[i]
	else:
		bsum = bsum + dat[i]
		
print(asum-bsum)
n=int(input())
def kaijo(n):
    if n==0:
        return(1)
    else:
        return(n*kaijo(n-1))
print(kaijo(n)%(10**9+7))


### FIXED CODE ###

n=int(input())
'''
import sys
sys.setrecursionlimit(1000000)
def kaijo(n):
    if n==0:
        return(1)
    else:
        n=n%(10**9+7)
        return(n*kaijo(n-1))
print(kaijo(n)%(10**9+7))
'''
ans=1
for i in range(1,n+1):
    ans=i*(ans%(10**9+7))
print(ans%(10**9+7))
day = input()
 
if(day=="SUN"):
  print(7)
elif(day=="MON"):
  print(6)
elif(day=="TUE"):
  print(5)
elif(day=="WEN"):
  print(4)
elif(day=="THU"):
  print(3)
elif(day=="FRI"):
  print(2)
elif(day=="SAT"):

### FIXED CODE ###

day = input()
     
if(day=="SUN"):
  print(7)
elif(day=="MON"):
  print(6)
elif(day=="TUE"):
  print(5)
elif(day=="WED"):
  print(4)
elif(day=="THU"):
  print(3)
elif(day=="FRI"):
  print(2)
elif(day=="SAT"):
  print(1)
A,B,C=map.(int,input().split())
if A+B==10 or A+B==12:
  if A+C==10 or A+C==12:
    if B+C==10 or B+C==12:
      
      print("YES")
    else:
      print("NO")

### FIXED CODE ###

M=list(map(int,input().split()))
if M.count(5)==2 and M.count(7)==1:
  print("YES")
else:
  print("NO")
def popcnt(x):
    return bin(x).count("1")

def main():
    N = int(input())
    Xs = input()
    X = int(Xs, 2)
    d = popcnt(X)

    lut = [0] * N
    lut[1] = 1
    for i in range(2, N):
        Xi = i % popcnt(i)
        lut[i] = lut[Xi] + 1

    dp = d+1
    dm = d-1
    mp = X % dp
    mm = X % dm
    # print(lut)
    # print(format(X, 'b'))
    
    ans = []
    for i in range(N):
        mask = 1 << (N-i-1)
        Xi = X ^ mask
        if Xs[i] == '1':
            m = (mm - pow(2, N-i-1, dm)) % dm
            # m = (mm - mask) % dm
        else:
            # m = (mp + mask) % dp
            m = (mp + pow(2, N-i-1, dp)) % dp
        # print(Xi, Xs[N-i-1], m)
        # print(format(Xi, 'b'))

        # Xi2 = Xi % dd
        # ans.append((Xi, Xi2))
        ans.append(lut[m] + 1)
    print(*ans, sep='\n')

if __name__ == '__main__':
    main()

### FIXED CODE ###


def popcnt(x):
    return bin(x).count("1")

def main():
    N = int(input())
    Xs = input()
    X = int(Xs, 2)
    d = popcnt(X)

    lut = [0] * N
    for i in range(1, N):
        Xi = i % popcnt(i)
        lut[i] = lut[Xi] + 1

    dp = d+1
    dm = d-1
    mp = X % dp
    mm = X % dm if dm else 0
    # print(lut)
    # print(format(X, 'b'))
    
    ans = []
    for i in range(N):
        mask = 1 << (N-i-1)
        Xi = X ^ mask
        _ans = 0
        if Xs[i] == '1':
            if dm:
                m = (mm - pow(2, N-i-1, dm)) % dm
                _ans = lut[m] + 1
            # m = (mm - mask) % dm
        else:
            # m = (mp + mask) % dp
            m = (mp + pow(2, N-i-1, dp)) % dp
            _ans = lut[m] + 1
        ans.append(_ans)
    print(*ans, sep='\n')

if __name__ == '__main__':
    main()
n=int(input())
arr=list(map(int,input().split()))
c=0
for i in range n:
  if i%2!=0 and arr[i]%2!=0:
    c+=1
print(c)

### FIXED CODE ###

n=int(input())
arr=list(map(int,input().split()))
c=0
for i in range(n):
  if (i+1)%2!=0 and arr[i]%2!=0:
    c+=1
print(c)
H, W = (int(x) for x in input().split())
if H * W % 2 == 0:
    k = H * W / 2
else:
    if H == 1 or W == 1:
        a = list(filter(lambda x: x != 1, [H, W]))
        k = int(a[0] / 2) + 1
    else:
        k = int(H/2) + (int(W/2))*H + 1
print(k)

### FIXED CODE ###

H, W = (int(x) for x in input().split())

if H == 1 or W == 1:
    k = 1
elif H*W % 2 == 1:
    k = int(H / 2) + (int(W / 2)) * H + 1
else:
    k = int(H * W / 2)

print(k)
nums = [int(x) for x in input()]

for i in range(5):
    if nums[i] == 0:
        print(i + 1)
        exit(0)


### FIXED CODE ###

nums = [int(x) for x in input().split(" ")]

for i in range(5):
    if nums[i] == 0:
        print(i + 1)
        exit(0)
H, W = map(int, input().split(" "))

result = True
masu = [[0 for i in range(H+2)] for j in range(W+2)]
for h in range(1, H+1):
    s = "0"+input()+"0"
    masu[h] = list(s)

# print(masu)    

for h in range(H):
    for w in range(W):
        if masu[h][w] == "#":
            if (masu[h][w] == masu[h+1][w]) or (masu[h][w] == masu[h][w+1]) or (masu[h][w] == masu[h-1][w]) or (masu[h][w] == masu[h][w-1]):
                pass
            else:
                result = False

if result:
    print("Yes")
else:
    print("No")

### FIXED CODE ###


H, W = map(int, input().split(" "))

# result = True
masu = [['.' for i in range(W+2)] for j in range(H+2)]
for h in range(H):
    s = "."+input()+"."
    masu[h+1] = s

# print(masu)

for h in range(1,H+1):
    for w in range(1,W+1):
        if masu[h][w] == "#":
            if "#" == masu[h+1][w] or "#" == masu[h][w+1] or "#" == masu[h-1][w] or "#" == masu[h][w-1]:
                pass
            else:
                # result = False
                print("No")
                exit()

print("Yes")
n=input()
s=input()

r=0
b=0

for i in s:
    if i=='R':
	r=r+1
    else:
        b=b+1

if r>b:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n=input()
s=input()

r=0
b=0

for i in s:
    if i=='R':
        r=r+1
    else:
        b=b+1

if r>b:
    print('Yes')
else:
    print('No')
s=list(input())
t=list(input())

s.sort()
t.sort()
t.reverse()

for i in range(len(s)):
  S=s[i]
for i in range(len(t)):
  T=t[i]
if S<=T:
  print('No')
elif S==T:
  print('No')
else:
  print('Yes')

### FIXED CODE ###

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

if a%2==0 and b%2==0:
  print(int((a+b)/2))
elif a%2==1 and b%2==1:
  print(int((a+b)/2))
elif a%2==0 and b%2==1:
  print(int((a+b+1)/2))
else:
  print(int((a+b+1)/2))
N = int(input())

j=0

for i in N:
  j = j + i

else:
  print(j)

### FIXED CODE ###

N = int(input())
t = 0

for i in range(N):
	t += i + 1 

print(t)
n,m=map(int,input())
h=list(map(int,input().split(" ")))
tall=[0]*n
for i in range(m):
  a,b=map(int,input().split())
  a-=1
  b-=1
  tall[a]=max(tall[a],h[b])
  tall[b]=max(tall[b],h[a])
res=0
for i in range(n):
  if h[i]>tall[i]:
    res+=1
print(res)

### FIXED CODE ###

n,m=map(int,input().split())
h=list(map(int,input().split()))
tall=[0]*n
for i in range(m):
  a,b=map(int,input().split())
  a-=1
  b-=1
  tall[a]=max(tall[a],h[b])
  tall[b]=max(tall[b],h[a])
res=0
for i in range(n):
  if h[i]>tall[i]:
    res+=1
print(res)
N,K = map(int,input().split())
A = list(map(int,input().split()))
MOD = 10**9+7

if all(a<0 for a in A):
    A.sort()
    ans = 1
    for _ in range(K):
        ans *= A.pop()
        ans %= MOD
    print(ans)
    exit()

arr = []
for a in A:
    if a < 0:
        arr.append((-a,1))
    else:
        arr.append((a,0))

arr.sort()
psz = []
ng = []
ans = 1
for _ in range(K):
    a,s = arr.pop()
    if s:
        ng.append(a)
    else:
        psz.append(a)

if len(ng)%2:
    ng.pop()
    while A:
        a,s = arr.pop()
        if s==0:
            ans = a
            break
    else:
        assert False

for a in ng:
    ans *= a
    ans %= MOD
for a in psz:
    ans *= a
    ans %= MOD
print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
A = list(map(int,input().split()))
MOD = 10**9+7

if all(a>=0 for a in A):
    A.sort()
    ans = 1
    for _ in range(K):
        ans *= A.pop()
        ans %= MOD
    print(ans)
    exit()
if all(a<0 for a in A):
    A.sort(reverse=K%2==0)
    ans = 1
    for _ in range(K):
        ans *= A.pop()
        ans %= MOD
    print(ans)
    exit()
if N==K:
    ans = 1
    for a in A:
        ans *= a
        ans %= MOD
    print(ans)
    exit()

arr = []
for a in A:
    if a < 0:
        arr.append((-a,1))
    else:
        arr.append((a,0))

arr.sort()
pz = []
ng = []
for _ in range(K):
    v,s = arr.pop()
    if s:
        ng.append(v)
    else:
        pz.append(v)

if len(ng)%2 == 0:
    ans = 1
    for v in ng:
        ans *= v
        ans %= MOD
    for v in pz:
        ans *= v
        ans %= MOD
    print(ans)
    exit()

b = pz[-1] if pz else None
c = ng[-1] if ng else None
a = d = None
while arr and (a is None or d is None):
    v,s = arr.pop()
    if s:
        if a is None:
            a = v
    else:
        if d is None:
            d = v

if (a is None or b is None) and (c is None or d is None):
    assert False

ans = 1
if a is None or b is None:
    ans = d
    for v in ng[:-1]:
        ans *= v
        ans %= MOD
    for v in pz:
        ans *= v
        ans %= MOD
elif c is None or d is None:
    ans = a
    for v in ng:
        ans *= v
        ans %= MOD
    for v in pz[:-1]:
        ans *= v
        ans %= MOD
else:
    if a*c > b*d:
        ans = a
        for v in ng:
            ans *= v
            ans %= MOD
        for v in pz[:-1]:
            ans *= v
            ans %= MOD
    else:
        ans = d
        for v in ng[:-1]:
            ans *= v
            ans %= MOD
        for v in pz:
            ans *= v
            ans %= MOD
ans %= MOD
print(ans)
S=input()
if S.count(1)>=S.count(0):
  print(S.count("0")*2)
else:
  print(S.count("1")*2)



### FIXED CODE ###

S=input()
if S.count("1")>=S.count("0"):
  print(S.count("0")*2)
else:
  print(S.count("1")*2)
A1, A2, A3= map(int, input().split())
sum=A1+A2+A3
if sum>=22:
    print(“bust”)
else:
    print(“win”)

### FIXED CODE ###

A1, A2, A3= map(int, input().split())
sum=A1+A2+A3
if sum>=22:
    print('bust')
else:
    print('win')
n = input()

n = int(n)
s = [0]*n
sm = []

for i in range(0,n):
  s[i] = input()

for i in range(0,n):
  c = 1
  sm.insert(0,s[i])
  for j in range(1,len(sm)):
    if(s[i] == sm[j]):
      del sm[0]

print(len(sm))

### FIXED CODE ###

n = int(input())
s = [0]*n

for i in range(n):
  s[i] = input()
ans = 0
s.sort()
for i in range(n-1):
  if s[i] != s[i+1]:
    ans += 1
    
print(ans+1)
import math

r  = int(input())
print(2 * math.PI * r)

### FIXED CODE ###

r  = int(input())
print(2 * 3.14 * r)
n = int(input())
A = list(map(int, input().split()))

Side = [0] * (10**5+1)
for a in A: Side[a] += 1

Side_2 = [i for i, x in enumerate(Side) if (x >= 2) and (x < 4)]
Side_4 = [i for i, x in enumerate(Side) if x >= 4]

if (len(Side_2) < 2) and not Side_4:
  print(0)
  exit()

if not Side_2 and Side_4:
  print(Side_4[-1]*2)
  exit()

if (len(Side_2) >= 2) and not Side_4:
  print(Side_2[-1]*Side_2[-2])
  exit()
  
if (len(Side_2) == 1) and Side_4:
  max2 = Side_2[-1]
  max4 = Side_4[-1]
  if max4 >= max2:
    print(max4*2)
    exit()
  else:
    print(max4*max2)
    exit()
    
if (len(Side_2) >= 2) and Side_4:
  max2 = Side_2[-1]
  max2_2 = Side_2[-2]
  max4 = Side_4[-1]
  if max4 >= max2:
    print(max4*2)
    exit()
  elif (max4 < max2) and (max4 <= max2_2):
    print(max2 * max2_2)
    exit()
  elif (max4 < max2) and (max4 > max2_2):
    print(max2 * max4)
    exit()

### FIXED CODE ###

from collections import Counter

n = int(input())
A = list(map(int, input().split()))
A_dic = Counter(A)

set_A = sorted((set(A)), reverse=True)
tmp = 0
for a in set_A:
    if A_dic[a] >= 4:
        print(max(tmp*a, a*a))
        exit()
    if A_dic[a] >= 2:
        ans = tmp * a
        if ans != 0:
            print(ans)
            exit()
        tmp = a
print(0)
n = int(input().strip())
L = list(map(int, input().strip().split()))
seen=set()
ans=0
for j in range(n):
    if j-L[j] in seen:
        ans+=1
    seen.add(A[j]+j)
print(ans)


### FIXED CODE ###

from collections import Counter
n = int(input().strip())
L = list(map(int, input().strip().split()))
seen=Counter()
ans=0
for j in range(n):
    # if j-L[j] in seen:
    ans+=seen[j-L[j]]
    seen[L[j]+j]+=1
print(ans)