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

N,M,K=map(int,input().split())
G=[]
F=[set([]) for _ in range(N)]
B=[set([]) for _ in range(N)]
for _ in range(M):
  a,b=map(int,input().split())
  F[a-1].add(b)
  F[b-1].add(a)
  p,i=True,0
  for g in G:
    if (a in g or b in g) and p:
      g|={a,b}
      j=i
      p=False
    elif a in g or b in g:
      G[j]|=g|{a,b}
      G.remove(g)
    i+=1
  if p:
    G.append({a,b})
for _ in range(K):
  a,b=map(int,input().split())
  B[a-1].add(b)
  B[b-1].add(a)
ans=[0]*N
for g in G:
  for i in g:
    ans[i-1]=len(g-F[i-1]-B[i-1]-{i})
print(*ans)

### FIXED CODE ###

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

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

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x==y:
            return
        elif self.rank[x-1] > self.rank[y-1]:
            self.par[x-1] += self.par[y-1]
            self.par[y-1] = x
        else:
            self.par[y-1] += self.par[x-1]
            self.par[x-1] = y
            if self.rank[x-1] == self.rank[y-1]:
                self.rank[y-1] += 1

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

    def count(self, x):
        return -self.par[self.find(x)-1]

from collections import deque

N,M,K=map(int,input().split())
U=UnionFind(N)
q=deque([])
for _ in range(M):
  a,b=map(int,input().split())
  U.union(a,b)
  deque.append(q,(a,b))
G=[set([]) for _ in range(N)]
for _ in range(M):
  a,b=deque.pop(q)
  if U.same(a,b):
    G[a-1].add(b)
    G[b-1].add(a)
for _ in range(K):
  a,b=map(int,input().split())
  if U.same(a,b):
    G[a-1].add(b)
    G[b-1].add(a)
ans=[0]*N
for i in range(1,N+1):
  ans[i-1]=U.count(i)-len(G[i-1])-1
print(*ans)
### BUGGY CODE ###

N, K = map(int, input().split())
A = [0] + list(map(int, input().split()))
score = [0]*(N+1)

s = 1
for i in range(1, K+1):
    s *= A[i]
score[K] = s

for i in range(K+1, N+1):
    score[i] = score[i-1]*A[i]//A[i-K]
    print('Yes' if score[i] > score[i-1] else 'No')

### FIXED CODE ###

N, K = map(int, input().split())
A = [0] + list(map(int, input().split()))


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

S = input()
mod = [0]
for d, c in enumerate(S[::-1]):
    mod.append((int(c) * 10**d + mod[-1]) % 2019)
from collections import *
print(sum(v * (v - 1) // 2 for v in Counter(mod).values()))


### FIXED CODE ###

S = input()
mod = [0]
for d, c in enumerate(S[::-1]):
    mod.append((int(c) * pow(10, d, 2019) + mod[-1]) % 2019)
from collections import *
print(sum(v * (v - 1) // 2 for v in Counter(mod).values()))
### BUGGY CODE ###

cnt=0
a,b,c=map(int,input().split())
while True:
	if b-a<=0:break
	for i in range(a,b):
		if (c%a==0):
			cnt+=1
			a+=1
	print(cnt)

### FIXED CODE ###

cnt=0
a,b,c=map(int,input().split())
for i in range(a,b+1):
	if (c%i==0):
			cnt+=1
print(cnt)
### BUGGY CODE ###

from collections import Counter

n = int(input())
s = [x for x in [Counter(list(input())) for _ in range(n)]]


alphabet = set('abcdefghijklmnopqrstuvwxyz')
s_list = [int('1' + ''.join([str(s_i[a]) for a in alphabet])) for s_i in s]

count = 0
i = 0

for x in s_list:
  i += 1
  temp = s_list[i:]
  hoge = s[i:]
  for y in temp:
    if y == x:
      count += 1
print(count)

### FIXED CODE ###

def sort_str(s):
  temp = sorted(list(s))
  return ''.join(list(temp))

n = int(input())
s = [input() for _ in range(n)]

s_dict = {}
count = 0

for s_i in s:
  k = sort_str(s_i)
  if k in s_dict:
    count += s_dict[k]
    s_dict[k] += 1
  else:
    s_dict[k] = 1
    
print(count)
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(N-1):
    for j in range(i+1,N):
        if j-i == A[i] + A[j]:
            ans += 1
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 0
p = {}
m = {}
for i in range(N):
    if p.get(i+A[i]) is None:
        p[i+A[i]] = 1
    else:
        p[i+A[i]] += 1
for i in range(N):
    if m.get(i-A[i]) is None:
        m[i-A[i]] = 1
    else:
        m[i-A[i]] += 1
for x in range(min(p),max(m)+1):
    if x in p and x in m:
        ans += p[x] * m[x]
print(ans)
### BUGGY CODE ###

def g(n, a):
    for i in range(1, 100):
        if a**i > n:
            return a**(i-1)
    return -1

def solve(n):
    if n < 6:
        return n
    a = g(n, 6)
    b = g(n, 9)
    return min(solve(n-a)+1, solve(n-b)+1)

# assert solve(127) == 4
# assert solve(3) == 3
# assert solve(44852) == 16

print solve(input())

### FIXED CODE ###

def g(n, a):
    for i in range(1, 100):
        if a**i > n:
            return a**(i-1)
    return -1

dp = {}
def solve(n):
    if n < 6:
        return n
    if not n in dp:
        a = g(n, 6)
        b = g(n, 9)
        dp[n] = min(solve(n-a)+1, solve(n-b)+1)
    return dp[n]

# assert solve(127) == 4
# assert solve(3) == 3
# assert solve(44852) == 16

print solve(input())
### BUGGY CODE ###

N,K=map(int,input().split())
H=[int(x) for x in input().split()]
if N<=K:
    print(0)
else:
    H.sort(reverse=True)
    for j in range(K):
        H.pop(0)
    print(sum(H))


### FIXED CODE ###

N,K=map(int,input().split())
H=[int(x) for x in input().split()]
if N<=K:
    print(0)
else:
    H.sort(reverse=True)

    del H[0:K]
    print(sum(H))
### BUGGY CODE ###

def resolve():
    '''
    code here
    '''
    import math
    N = int(input())
    A_list = [int(item) for item in input().split()]
    A_list.sort()

    cnt = 0

    while len(A_list) > 0:
        # print(A_list)
        cnt += 1
        temp = A_list[0]
        # print(temp)
        del A_list[0]

        is_same = False
        for item in A_list[:]:
            if item == temp:
                is_same = True
            if item % temp == 0:
                A_list.remove(item)
        
        if is_same:
            cnt -= 1

    print(cnt)




if __name__ == "__main__":
    resolve()


### FIXED CODE ###

def resolve():
    '''
    code here
    '''
    import collections
    N = int(input())
    A_list = [int(item) for item in input().split()]

    A_list.sort()


    dp = [0 for item in range(A_list[-1]+1)]
    for item in A_list:

        temp = item
        while temp <= A_list[-1]:
            dp[temp] += 1
            temp += item

    cnt = 0
    for item in A_list:
        if dp[item] == 1:
            cnt += 1
    print(cnt)

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

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

dis = 300000000

for i in range(N-K+1):
    y = list(x[i:i+K])

    disl = abs(x[i]) + abs(x[i+K-1]-x[i])
    disr = abs(x[i+K-1]) + abs(x[i+K-1]-x[i])

    dis = min(dis, disl, disr)
#    if (y[0]*y[-1]<0):
#        disy = y[-1]-y[0]+min(abs(y[-1]), abs(y[0]))
#    else:
#        disy = max(abs(y[0]), abs(y[-1]))
#    dis = min(dis, disy)

print(dis)

### FIXED CODE ###

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

dis = 300000000

for i in range(N-K+1):
    disl = abs(x[i]) + abs(x[i+K-1]-x[i])
    disr = abs(x[i+K-1]) + abs(x[i+K-1]-x[i])

    dis = min(dis, disl, disr)
#    if (y[0]*y[-1]<0):
#        disy = y[-1]-y[0]+min(abs(y[-1]), abs(y[0]))
#    else:
#        disy = max(abs(y[0]), abs(y[-1]))
#    dis = min(dis, disy)

print(dis)
### BUGGY CODE ###

n,m = map(int,input().split())
A = list(map(int,input().split()))
from itertools import accumulate
A = list(accumulate([0]+A))
A = [a % m for a in A]

lst = [0 for i in range(m)]

for a in A:
  lst[a] += 1
  
def comb2(n):
  return n*(n-1)//2

ans = 0
for a in lst:
  ans += comb2(a)
print(ans)

### FIXED CODE ###

n,m = map(int,input().split())
A = list(map(int,input().split()))
from itertools import accumulate
A = accumulate([0]+A)

A = [a % m for a in A]

lst = {}

for a in A:
  if a not in lst:
    lst[a] = 0
  lst[a] += 1
  
def comb2(n):
  return n*(n-1)//2

ans = 0
for key in lst:
  ans += comb2(lst[key])
print(ans)
### BUGGY CODE ###

a, b, x = list(map(int, input().split()))
print(sum([c%x==0 for c in range(a,b+1)]))

### FIXED CODE ###

a, b, x = list(map(int, input().split()))
print(b//x-(a-1)//x)
### BUGGY CODE ###

from collections import Counter
n = int(input())
a = list(map(int, input().split()))
ans = [0]*n
for k in range(n):
    b = a[:]
    del b[k]
    #print(b)
    """もっといいやりかたある
    for l in range(n-2):
        for m in range(l+1, n-1):
            if b[l] == b[m]:
                count[k] += 1
    """
    c = Counter(b)  # ｂの要素の数と値の辞書を出してくれる
    #print(c)
    #print(c.keys())
    #print(c.values())
    for m in c.values():  # Counterで出した辞書の値（values)のリストの中身でfor
        ans[k] += int((m*(m-1))/2)  # mC2をしている

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

### FIXED CODE ###

from collections import Counter

n = int(input())
a = list(map(int, input().split()))
ans = 0
c = Counter(a)  # aの要素の数と値の辞書を出してくれる
#print(c)
#print(c.keys())
#print(c.values())
for m in c.values():  # Counterで出した辞書の値（values)のリストの中身でfor
    ans += int((m*(m-1))/2)  # mC2をしている


for k in range(n):
    #print(c[a[k]])
    print(ans - (c[a[k]] - 1))
    """
    c[a[k]]-1というのはｋ番目のボールを隠す前と隠した後についての差。
    隠す前、aのリストにA_kがｍ個あったとする。隠した後、aのリストにA_kはｍ－１個
    なので、mC2 - (m-1)C2 = m-1 である。ここでｍとはc[a[k]]なので、上が成り立つ。
    """
### BUGGY CODE ###

import sys
sys.setrecursionlimit(1000000)
 
N, u, v = map(int, input().split())
 
u -= 1
v -= 1
 
graph = [[] for i in range(N)]
for i in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)
 
lst = []
def calcDist(cur, par, dst):
    global lst
    lst[cur] = dst
    for neighbour in graph[cur]:
        if neighbour == par: continue
        calcDist(neighbour, cur, dst + 1)
        
uDist = [None for i in range(N)]
vDist = [None for i in range(N)]
lst = uDist
calcDist(u, -1, 0)
lst = vDist
calcDist(v, -1, 0)
 
best = 0

for node in range(N):
    if uDist[node] < vDist[node]: best = max(best, vDist[node] - 1)
print(best)


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
 
N, u, v = map(int, input().split())
 
u -= 1
v -= 1
 
graph = [[] for i in range(N)]
for i in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)
 
lst = []
def calcDist(cur, par, dst):
    global lst
    lst[cur] = dst
    for neighbour in graph[cur]:
        if neighbour == par: continue
        calcDist(neighbour, cur, dst + 1)
        
uDist = [None for i in range(N)]
vDist = [None for i in range(N)]
lst = uDist
calcDist(u, -1, 0)
lst = vDist
calcDist(v, -1, 0)
 
best = 0
 
for node in range(N):
    if uDist[node] < vDist[node]: best = max(best, vDist[node] - 1)
print(best)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import sys
from collections import defaultdict
from fractions import gcd
N=int(sys.stdin.readline().strip())
A=map(int, sys.stdin.readline().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

pairwise_coprime=True

SOINSU=defaultdict(lambda: 0)

setwise_coprime=None
for i,a in enumerate(A):
    #全ての数が互いに素か　pairwise coprime判定
    f=factorization(a)
    for x in f:
        if SOINSU[x]==1:
            pairwise_coprime=False
            break
        SOINSU[x]=1
    #GCDの累積を取る　setwise coprime判定
    if i==0:
        setwise_coprime=a
    else:
        setwise_coprime=gcd(setwise_coprime,a)

if pairwise_coprime==True:
    print "pairwise coprime"
elif setwise_coprime==1:
    print "setwise coprime"
else:
    print "not coprime"

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
from collections import defaultdict
from fractions import gcd
N=int(sys.stdin.readline().strip())
A=map(int, sys.stdin.readline().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

pairwise_coprime=True

SOINSU=defaultdict(lambda: 0)

setwise_coprime=None
for i,a in enumerate(A):
    #全ての数が互いに素か　pairwise coprime判定
    if pairwise_coprime==False:
        pass
    else:
        f=factorization(a)
        for x in f:
            if SOINSU[x]==1:
                pairwise_coprime=False
                break
            SOINSU[x]=1
    #GCDの累積を取る　setwise coprime判定
    if i==0:
        setwise_coprime=a
    else:
        setwise_coprime=gcd(setwise_coprime,a)

if pairwise_coprime==True:
    print "pairwise coprime"
elif setwise_coprime==1:
    print "setwise coprime"
else:
    print "not coprime"
### BUGGY CODE ###

n,w=map(int,input().split())
l=[[]]
for i in range(n):
  l.append(list(map(int,input().split())))
dp=[[-1 for i in range(w+1)] for j in range(n+1)]
for i in range(w+1):
  dp[0][i]=0
for j in range(n+1):
  dp[j][0]=0
def knap(x,y):
  if dp[x][y]!=-1:
    return dp[x][y]
  else:
    if l[x][0]>y:
      res=knap(x-1,y)
    else:
      res=max(knap(x-1,y),knap(x-1,y-l[x][0])+l[x][1])
    dp[x][y]=res
    return res
knap(n,w)
print(dp[n][w])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
def knapsack(N,W,weight,value):
  #初期化
  inf=float("inf")
  dp=[[-inf for i in range(W+1)] for j in range(N+1)]
  for i in range(W+1): dp[0][i]=0

  #DP
  for i in range(N):
    for w in range(W+1):
      if weight[i]<=w: #dp[i][w-weight[i]の状態にi番目の荷物が入る可能性がある
        dp[i+1][w]=max(dp[i][w-weight[i]]+value[i], dp[i][w])
      else: #入る可能性はない
        dp[i+1][w]=dp[i][w]
  return dp[N][W]
n1,w1=map(int,input().split())
lw=[]
lv=[]
for i in range(n1):
  w,v=map(int,input().split())
  lw.append(w)
  lv.append(v)
print(knapsack(n1,w1,lw,lv))
### BUGGY CODE ###

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


def count(x):
    return x*(x-1)//2


for i in A:
    counter = 0
    for kind in se_:
        if kind == i:
            counter += count(A.count(kind)-1)
        else:
            counter += count(A.count(kind))  
    print(counter)


### FIXED CODE ###

from collections import Counter
N = int(input())
A = list(map(int,input().split()))
se_ = Counter(A)
key = se_.keys()
 
 
all = 0
for i in key:
    all += se_[i]*(se_[i]-1)//2
    
 
for i in A:
    final=0
    final = all -se_[i]+1
    print(final)
### BUGGY CODE ###

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

ans = 0
for n in a:
    ans = max(a.count(n-1) + a.count(n) + a.count(n+1), ans)

print(ans)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
A = [0] * (10 ** 5 + 5)
for ai in a:
    A[ai - 1] += 1
    A[ai] += 1
    A[ai + 1] += 1
print(max(A))
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
B = list(set(A))
li = []
for i in B:
    tmp = A.count(i)
    if tmp>1:
        for j in range(tmp//2):
            li.append(i)
li.sort()
if len(li)>1:
    print(li[-1]*li[-2])
else:
    print(0)

### FIXED CODE ###

import collections
N = int(input())
A = list(map(int,input().split()))
B = collections.Counter(A)
C = [i[0] for i in B.items() if i[1] >= 2]
D = [i[0] for i in B.items() if i[1] >= 4]
C.sort(reverse=True)
D.sort(reverse=True)
if len(C)==0 or len(C)==1 and len(D)==0:
    print(0)
elif len(C)>1 and len(D)==0:
    print(C[0]*C[1])
elif len(C)==0 and len(D)>0:
    print(D[0]*2)
elif len(C)==1 and len(D)>0:
    print(max(C[0]*D[0],D[0]*2))
else:
    print(max(D[0]*2,C[0]*C[1],C[0]*D[0]))
### BUGGY CODE ###

S = input()

i = 0
while i <= len(S) - 1:
    if S[i] == "d":
        if i + 10 < len(S):
            if S[i + 10]  == "r":
                if S[i:i+11] != "dreameraser":
                    print("NO")
                    exit()
                else:
                    i += 11
        elif i + 6 < len(S):
            if S[i+6] == "r":
                if S[i:i+7] != "dreamer":
                    print("NO")
                    exit()
                else:
                    i += 7
            elif S[i:i+6] != "dream":
                print("NO")
                exit()
            else:
                i += 6
        elif S[i:i+6] != "dream":
                print("NO")
                exit()
        else:
            i += 6
    elif S[i] == "e":
        if i + 5 < len(S):
            if S[i+5] == "r":
                if S[i:i+6] != "eraser":
                    print("NO")
                    exit()
                else:
                    i += 6
            elif S[i:i+5] != "erase":
                print("NO")
                exit()
            else:
                i += 5
        elif S[i:i+5] != "erase":
                print("NO")
                exit()
        else:
            i += 5
    else:
        print("NO")
        exit()
print("YES")


### FIXED CODE ###

T = input()

S = T[::-1]
i = 0
while i <= len(S) - 1:
    if S[i] == "r":
        if S[i:i+7] == "remaerd":
            i += 7
        elif S[i:i+6] == "resare":
            i += 6
        else:
            print("NO")
            exit()
    elif S[i] == "m":
        if S[i:i+5] == "maerd":
            i += 5
        else:
            print("NO")
            exit()
    elif S[i] == "e":
        if S[i:i+5] == "esare":
            i += 5
        else:
            print("NO")
            exit()
    else:
        print("NO")
        exit()
print("YES")
### BUGGY CODE ###

from bisect import bisect_left

N,M = map(int, input().split())
A = sorted([int(x) for x in input().split()])

for i in range(M):
    x = A.pop(-1)
    x //= 2
    A.insert(bisect_left(A, x), x)

print(sum(A))

### FIXED CODE ###

from bisect import bisect_left
 
N,M = map(int, input().split())
A = sorted([int(x) for x in input().split()])
 
while M > 0:
    x = A.pop(-1)
    x //= 2
    ind = bisect_left(A, x)
    M -= 1
    if ind < N-1:
        temp = [x] + [A[-i-1]//2 for i in range(min(M, N-1 - ind))]
        A = sorted(A[:N-len(temp)] + temp)
    else:
        A.insert(bisect_left(A, x), x)
    M -= N-1 - ind
 
print(sum(A))
### BUGGY CODE ###

from functools import lru_cache
import sys

sys.setrecursionlimit(10**6)

N=int(input())
h=[int(i) for i in input().split()]
@lru_cache(maxsize=10**13)
def cost(n):
    if n == 0:
        return 0
    elif n == 1:
        return abs(h[1]-h[0])
    else:
        return min(cost(n-2)+abs(h[n]-h[n-2]), cost(n-1)+abs(h[n]-h[n-1]))
print(cost(N-1))

### FIXED CODE ###

N=int(input())
h=[int(i) for i in input().split()]
cost = [-1]*N
cost[0]=0
cost[1]=abs(h[1]-h[0])
for i in range(2,N):
    cost[i] = min(cost[i-2]+abs(h[i]-h[i-2]), cost[i-1]+abs(h[i]-h[i-1]))
print(cost[-1])
### BUGGY CODE ###

s=[0 for i in range(60)]
def totwo(x):
  return [int(x&(2**i)>0) for i in range(60)]

n=int(input())
a=list(map(lambda x:totwo(int(x)),input().split()))

d=[a[0][i] for i in range(60)]
for i in range(1,n):
  for j in range(60):
    if a[i][j]:
      s[j]+=i-d[j]
    else:
      s[j]+=d[j]
    d[j]+=a[i][j]

ss=0
r=1
mod=10**9+7
for i in range(60):
  ss=(ss+r*s[i])%mod
  r=(r*2)%mod
print(ss)



### FIXED CODE ###

s=[0 for i in range(60)]
def totwo(x):
  return [int(x&(2**i)>0) for i in range(60)]

n=int(input())
a=list(map(lambda x:totwo(int(x)),input().split()))

d=[a[0][i] for i in range(60)]
for i in range(1,n):
  for j in range(60):
    if a[i][j]:
      s[j]+=i-d[j]
    else:
      s[j]+=d[j]
    d[j]+=a[i][j]

ss=0
r=1
mod=10**9+7
for i in range(60):
  ss=(ss+r*s[i])%mod
  r=(r*2)%mod
print(ss)
### BUGGY CODE ###

s = input()
n = len(s)
list_count = []
for i in range(1, n + 1):
  sub_str = s[:i]
  count_g = sub_str.count("g")
  count_p = sub_str.count("p")
  list_count.append(count_g - count_p)

point = 0
while list_count[-1] >= 2:
  for back_index in range(n)[::-1]:
    if list_count[back_index] < 2:
      list_count = [value if index <= back_index else value - 2 for index, value in enumerate(list_count)]
      point += 1
      break
print(point)

### FIXED CODE ###

s = input()
point = 0
count_g = 0
count_p = 0
for enemy_move in s:
  if enemy_move == "g":
    if count_g > count_p:
      point += 1
      count_p += 1
    else:
      count_g += 1
  else:
    if count_g > count_p:
      count_p += 1
    else:
      count_g += 1
      point -= 1
print(point)
### BUGGY CODE ###

N=int(input())
S=input()
R=[]
G=[]
B=[]
count=1
for i in S:
    if i=="R":
        R.append(count)
    if i=="G":
        G.append(count)
    if i=="B":
        B.append(count)
    count+=1
ans=0
for j in R:
    for k in G:
        x=len(B)
        if 2*j-k in B:
            x-=1
        if 2*k-j in B:
            x-=1
        if (k+j)/2==(k+j)//2 and (k+j)//2 in B:
            x-=1
        ans+=x
print(ans)


    









        

    









    

        




    















    



    





    






        






    
















        


























            
    


    


    
    














    


    














### FIXED CODE ###

N=int(input())
S=list(input())
S.insert(0,0)
R=S.count("R")
G=S.count("G")
B=S.count("B")
ans=R*G*B
for i in range(1,N-1):
    for j in range(i+1,N):
        k=2*j-i
        if k<N+1 and S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
            ans-=1
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
import fractions
from functools import reduce
n = int(input())
A = []
A = list(map(int, input().split()))
mod = 10**9 + 7
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
Z = lcm(*A)
ans = sum(Z//a%mod for a in A)%mod
print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline
import fractions
N=int(input())
A=list(map(int,input().split()))
c=1
a=0
w=10**9+7
for A_ in A:
    c=c*A_//fractions.gcd(c,A_)
for A_ in A:
    a+=c//A_
print(int(a%w))
### BUGGY CODE ###

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


ans = []
for i in range(n):
    temp = 0
    for j, aa in enumerate(a):
        if j == i:
            continue
        temp = temp ^ aa
    ans.append(temp)

ans = [str(i) for i in ans]
print(" ".join(ans))


### FIXED CODE ###

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


ans = []
alld = 0

for aa in a:
    alld = alld ^ aa

for  aa in a:
    ans.append(alld ^ aa)

ans = [str(i) for i in ans]
print(" ".join(ans))