Harryxun/stf_run huggingface dataset:
L = [int(input()) for i in range(5)]
L1 = [x for x in L if x%10 ==0 ]
L2 = [x for x in L if x%10 !=0 ]
L3 = [x%10 for x in L2 ]

idx = L3.index(min(L3))
for i in range(len(L2)):
    if i != idx:
        L2[i] = (L2[i]//10+1)*10
if L1:
    a = sum(L1)
else:
    a =0
if L2:
    b = sum(L2)
else:
    b = 0
print(a+b)

### FIXED CODE ###

L = []
for i in range(5):
    L.append(int(input()))

L1 = [x for x in L if x%10 == 0]
L2 = [x for x in L if x%10 != 0]
L3 = [(x%10,x//10) for x in L2]

ans = sum(L1)
if len(L3)>0:
  L3.sort(reverse = True)
  for i in range(len(L3)-1):
    ans += (L3[i][1]+1)*10
  ans += L3[-1][1]*10+L3[-1][0]
print(ans)
N=int(input())
print(sum(range(1,N))

### FIXED CODE ###

N=int(input())
print(sum(range(1,N)))
import sys
import numpy as np

input = sys.stdin.readline
N = int(input())
B = [int(i)*2 for i in input().split()]

#a = [[0]*N for i in range(N)]
A = np.identity(N)
for i in range(N-1):
    #A[i][i] += 1
    A[i][i+1] += 1

A[-1][0] += 1
#A[-1][-1] += 1
#A = np.array(a)
b = np.array(B)

x = np.linalg.solve(A, b)

for i in x:
  print(int(i), end=" ")

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

s = sum(a)
x = [None]*N
x[0] = s - 2 * (sum(a[1::2]))

for i in range(1,N):
    x[i] = 2 * a[i-1] - x[i-1]

print(*x)
def main():
    from functools import reduce
    from fractions import gcd
    from collections import deque

    n, *a = map(int, open(0).read().split())
    p = deque(a)
    edge1 = reduce(gcd, a[1:])
    edge2 = reduce(gcd, a[:-1])
    full = reduce(gcd, a)
    ans = max([edge1, edge2, full])
    gl = p.pop()
    tmp = gl
    for i in range(n - 2):
        tmp2 = p.pop()
        gr = reduce(gcd, p)
        gl = gcd(gl, tmp)
        tmp = tmp2
        g = gcd(gl, gr)
        ans = max(ans, g)

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

a,b,t=map(int,input().split())
print(t//a*b)
S = int(input())
A,B = map(int,input().split())
check = false
while S <= B:
  S *= S
  if A <= S and B >= S:
    check = true
    break
if check:
  print('OK')
else:
  print('NG')

### FIXED CODE ###

S = int(input())
A,B = map(int,input().split())
check = False
ans = 0
i = 1
while ans <= B:
  ans = S * i
  if A <= ans and B >= ans:
    check = True
    break
  i += 1
if check:
  print('OK')
else:
  print('NG')
def main():
    h, n = map(int, input().split())
    ab = [list(map(int, input().split())) for _ in range(n)]

    dp = [0] + [0] * h
    for i in range(1, h + 1):
        dp[i] = min(dp[i - a] + b for a, b in ab)
    print(dp[h])


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    h, n = map(int, input().split())
    ab = [list(map(int, input().split())) for _ in range(n)]

    amax = max(a for a, b in ab)
    dp = [0] + [0] * (h + amax)
    for i in range(1, h + 1):
        dp[i] = min(dp[i - a] + b for a, b in ab)
    print(dp[h])


if __name__ == '__main__':
    main()
a5=[]
while 1:
    x=int(input())
    if x==0:
        break
    a5.append(x)
j = 0
for i in a5:
    print("Case " + j+1+": "+ i)
    j=j+1


### FIXED CODE ###

a5=[]
while True:
    x=int(input())
    if x==0:
        break
    a5.append(x)
j = 0
for i in a5:
    print("Case " + str(j+1)+": "+ str(i))
    j=j+1
#num = list(map(int,input().split()))
num = [i for i in range (1,int(input())+1)]
ans = 0
count = 0

for j in range(9,99):
	num[j]=0

for k in range(999,9999):
	num[k]=0

for l in range(len(num)-1):
	if not num[l]==0:
		count+=1

print(count)

### FIXED CODE ###

num = [i for i in range (1,int(input())+1)]
ans = 0

if num[-1]<=9 :
	ans = num[-1]
elif num[-1]<=99 :
	ans = 9
elif num[-1]<=999 :
	ans = num[-1]-90
elif num[-1]<=9999:
	ans = 909
elif num[-1]<=99999 :
	ans = num[-1]-9090
else :
	ans = 90909

print(ans)
import copy
INF = float('inf')
N = int(input())
a = []
for i in range(N):
    a.append(list(map(int, input().split())))
flag = 0
length = 0


for i in range(N):
    for j in range(N):
        muda = 0
        for k in range(N):
            if k == i or k == j:
                continue
            mix = b[i][k] + b[k][j]
            if a[i][j] > mix:
                flag = 1
            elif a[i][j] == mix:
                muda = 1
        if muda == 1:
            continue
        length += a[i][j]

if (flag == 0):
    length = int(length/2)
else:
    length = -1
print(length)


### FIXED CODE ###

import numpy as np
import scipy.sparse.csgraph as graph

N = int(input())
G = np.array([list(map(int, input().split())) for i in range(N)])

G2 = graph.floyd_warshall(G, directed=False)

if np.any(G != G2):
    print(-1)
    exit()
else:
    c = [2*10**9]*N
    d = np.diag(c)
    G += d
    ans = 0
    for i in range(N):
        for j in range(i+1, N):
            two = np.min(G[i]+G[j])
            if two != G[i,j]:
                ans += G[i,j]

print(ans)
n,k=map(int,input().split())
AA=set([])
for i in range(n):
  d=int(input())
  A=list(map(int,input().split()))
  AA=AA|set(A)#|は「パイプ」和集合
print(n-len(AA))

### FIXED CODE ###

n,k=map(int,input().split())
S=[0]*n
for i in range(k):
  d=int(input())
  A=list(map(int,input().split()))
  for j in range(d):
    S[A[j]-1]+=1
ans=0
for i in range(n):
  if S[i]==0:
    ans=ans+1
print(ans)
import itertools
##print(ord("A"))
#n = int(input())
n,k,q = map(int,input().split())
#h = list(map(int,input().split()))	
ans_list=[input() for i in range(q)]
pnt_list = [k-q]*n
#print(pnt_list)
for i in range(q):

    pnt_list[int(ans_list[i])]+=1
#print(pnt_list)
for i in range(len(pnt_list)):
    if pnt_list[i]>0:
        print("Yes")
    else:
        print("No")
"""
for i in range(q):
    #print(pnt_list)
    for j in range(n):
    
        if ans_list[i]==str(j+1):
            pass
        else:
            pnt_list[j]=pnt_list[j]-1
for i in range(len(pnt_list)):
    if pnt_list[i]>0:
        print("Yes")
    else:
        print("No")
#print(pnt_list)
"""

### FIXED CODE ###

import itertools
##print(ord("A"))
#n = int(input())
n,k,q = map(int,input().split())
#h = list(map(int,input().split()))	
ans_list=[input() for i in range(q)]
pnt_list = [k-q]*n
#print(pnt_list)
for i in range(q):

    pnt_list[int(ans_list[i])-1]+=1
#print(pnt_list)
for i in range(len(pnt_list)):
    if pnt_list[i]>0:
        print("Yes")
    else:
        print("No")
while 1:
	e = input()
	if e == 0: break
	ans = 3*e
	for z in range(e+1):
		z3 = z**3
		if z3 > e: break
		for y in range(e+1):
			x = e - y**2 - z3
			if x >= 0:
				ans = min(ans,x+y+z)
			else:
				break
	print ans

### FIXED CODE ###

while 1:
	e = ans = input()
	if e == 0: break
	for z in range(e):
		z3 = z**3
		if z3 > e: break
		y = int((e-z3)**0.5)
		ans = min(ans,e+y+z-y**2-z3)
	print ans
def solve()
    N = input()
    a = ['']
    for i in input().split():
        a.inser(int(i)-1, i)
    return *a[-1]and[-1]or a

print(solve())

### FIXED CODE ###

from queue import Queue

def solve():
    N = int(input())
    b = list(map(int, input().split()))
    idx = [i+1 for i in reversed(range(N))]
    
    l = []
    for i in range(N):
        for bi, j in zip(reversed(b), idx):
            if j == bi:
                l.append(str(j))
                break
        del idx[0], b[j-1]
    
    return '\n'.join(reversed(l)) if len(l) == N else -1

print(solve())
s, t = input(), input()

ans = 0

for i in range(len(s) - len(t) + 1):
  count = 0
  for j in range(len(t)):
    if s[i][j] == t[j]:
      count += 1

if ans <= count:
  ans = count
print(len(t) - count)

### FIXED CODE ###

s = input()
t = input()
 
ans = 0
 
for i in range(len(s) - len(t) + 1):
  count = 0
  for j in range(len(t)):
    if s[i + j] == t[j]:
      count += 1
 
  if ans <= count:
    ans = count
print(len(t) - ans)
n,k = map(int,input().split())
r,s,p = map(int,input().split())
T = int(input())

scores = {'r':p,'s':r,'p':s}


ans = 0
memo = []

for i in range(n):
  if i < k:
    ans += scores[T[i]]
    memo.append(T[i])
  else:
    if memo[i-k] == T[i]:
      memo.append('N')
    else:
      ans += scores[T[i]]
      memo.append(T[i])
print(ans)
      

### FIXED CODE ###

n,k = map(int,input().split())
r,s,p = map(int,input().split())
t = input()
score = {'r':p, 's':r ,'p':s}
from collections import deque
past = deque([])

ans = 0
for i in range(n):
  if i < k:
    ans += score[t[i]]
    past.append(t[i])
  else:
    if past.popleft() != t[i]:
      ans += score[t[i]]
      past.append(t[i])
    else:
      past.append('nn')
      
  
print(ans)
n=int(input())
a=[list(map(input().split())) for _ in range(n)]
x=input()
cnt='x'
for i in a:
  if cnt!='x':
    z=int(i[1])
    cnt+=z
    if i[0]==x:
    cnt=0
print(cnt)

### FIXED CODE ###

n=int(input())
a=[(input().split()) for _ in range(n)]
x=input()
cnt='x'
for i in a:
  if cnt!='x':
    z=int(i[1])
    cnt+=z
  if i[0]==x:
    cnt=0
print(cnt)
S = input()
if S == 'Sunny':
  print('Cloudy')
else if S == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')


### FIXED CODE ###

s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')
n=input()
for i in range(len(n)):
    if n[i] ==9:
        print('Yes')
        break
        else:
            print('No')


### FIXED CODE ###

# coding: utf-8
# Your code here!
n=input()
if n[0]=='9':
    print('Yes')
    exit()
if n[1]=='9':
    print('Yes')
    exit()
else:
    print('No')
n,*aa = map(int, open(0).read().split())
MOD = 10**9+7

from collections import defaultdict
from math import sqrt, ceil
def factors(x):
    d = defaultdict(int)
    while x % 2 == 0:
        d[2] += 1
        x //= 2
    for i in range(3, ceil(sqrt(x)) + 2, 2):
        while x % i == 0:
            d[i] += 1
            x //= i
    if x > 1:
        d[x] += 1
    return d

factors_of_aa = list(map(factors, aa))

factors_of_lcm = defaultdict(int)
for factors_of_a in factors_of_aa:
    for k in factors_of_a:
        factors_of_lcm[k] = max(factors_of_lcm[k], factors_of_a[k])
lcm = 1
for factor, cnt in factors_of_lcm.items():
    lcm *= pow(factor, cnt, MOD)

ans = 0
for factors_of_a in factors_of_aa:
    to_add = lcm
    for factor, cnt in factors_of_a.items():
        to_add *= pow(factor, -cnt, MOD)
        to_add %= MOD
    ans += to_add
    ans %= MOD

print(ans)

### FIXED CODE ###

n,*aa = map(int, open(0).read().split())
MOD = 10**9+7

from collections import defaultdict
from math import sqrt, ceil
def factors(x):
    d = defaultdict(int)
    while x % 2 == 0:
        d[2] += 1
        x //= 2
    for i in range(3, ceil(sqrt(x)) + 2, 2):
        while x % i == 0:
            d[i] += 1
            x //= i
    if x > 1:
        d[x] += 1
    return d

factors_of_aa = list(map(factors, aa))

factors_of_lcm = defaultdict(int)
for factors_of_a in factors_of_aa:
    for k in factors_of_a:
        factors_of_lcm[k] = max(factors_of_lcm[k], factors_of_a[k])
lcm = 1
for factor, cnt in factors_of_lcm.items():
    lcm *= pow(factor, cnt, MOD)

ans = 0
for factors_of_a in factors_of_aa:
    to_add = lcm
    for factor, cnt in factors_of_a.items():
        to_add *= pow(factor, -cnt, MOD)
        to_add %= MOD
    ans += to_add
    ans %= MOD

print(ans)
a,b,c=sorted(map(int, input().split())
print(a-2*b+c)

### FIXED CODE ###

a,b,c=sorted(map(int, input().split()))
print(c-a)
s=sorted;print("NYoe s"[s(input())<s(input())[::-1]::2])

### FIXED CODE ###

import math
a,b=map(int,input().split())
print(math.ceil((a+b)/2))
from collections import Counter
n = int(input())
s = input()
a_list = s.split()
dic =  Counter(a_list)
k = 1
while k <= n:
  print(dic[str(k)])
  k += 1

### FIXED CODE ###

import math
a = int(input())
b = 2*a*math.pi
print(b)
A, B, C = map(int, input().split())

if (A = B and B = C) or (A != B and B != C and C != A):
    print("No")

else:
    print("Yes")


### FIXED CODE ###

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

if (A == B and B == C) or (A != B and B != C and C != A):
    print("No")

else:
    print("Yes")
N,D = list(map(int,input().split()))
human = 1
kanshi = 2*D+1
haniwhile hani < N:
    hani = hani + kanshi
    human +=1
    
print(human) = kanshi


### FIXED CODE ###

N,D = list(map(int,input().split()))
human = 1
hani = 2*D+1
while hani < N:
    hani = hani + (2*D+1)
    human +=1
    
print(human)
K, N = map(int, input().split())
A = list(map(int, input().split()))

A.append(A[0]+K)

print(A)

for i in range(K):
  L = A[i+1]-A[i]
ans = K-max(L)

print(ans)

### FIXED CODE ###

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

A.append(A[0]+K)
L = []

for i in range(N):
  a = A[i+1]-A[i]
  L.append(a)
ans = K-max(L)

print(ans)
n = int(input())
print(n-(n%1000))%1000

### FIXED CODE ###

n = int(input())
print((1000-(n%1000))%1000)
s = input()
q = int(input())
for i in range(q):
    query = list(map(str, input().split()))
    if len(query) == 1:
        s = s[::-1]
    else:
        if int(query[1]) == 1:
            s = query[2] + s
        else:
            s = s + query[2]
print(s)            

### FIXED CODE ###

s = input()
if s[0] == s[1] == s[2]:
    print('No')
else:
    print('Yes')
def abc070_c():
    from math import gcd
    n = int(input())
    t = [int(input()) for _ in range(n)]
    ans = 1
    for i in range(n):
        ans = int(ans * t[i] / gcd(ans, t[i]))

    print(ans)


abc070_c()

### FIXED CODE ###

def abc070_c():
    from fractions import gcd
    n = int(input())
    t = [int(input()) for _ in range(n)]
    ans = t[0]
    for v in t:
        ans = ans * v // gcd(ans, v)

    print(ans)


abc070_c()
from scipy.special import comb

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

for k, val in enumerate(A):
    count = 0
    nums = [0] * N
    for i, v in enumerate(A):
        if k == i:
            continue
        nums[v] += 1
    combs = list(map(lambda n: int(comb(n, 2)), nums))
    print(sum(combs))

### FIXED CODE ###

from math import factorial

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

def comb(n, r):
    if n - r < 0:
        return 0
    else:
        return factorial(n) // (factorial(n - r) * factorial(r))

nums = [0] * (N + 1)
for i, v in enumerate(A):
    nums[v] += 1
combs = list(map(lambda n: comb(n, 2), nums))
total = sum(combs)

for k, val in enumerate(A):
    print(total - (nums[val] - 1))
s=input()
test=0
i=0
n=len(s)
if n%2==0:
   while  i<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
else:
   while i+1<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
   else:
      if s[i+1]=="L":
         test+=1
if test==0:
   print("Yes")
else:
   print("No")


### FIXED CODE ###

s=input()
test=0
i=0
n=len(s)
if n%2==0:
   while  i<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
else:
   while i+1<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
   else:
      if s[i]=="L":
         test+=1
if test==0:
   print("Yes")
else:
   print("No")
x1, y1, x2, y2 = map(int, input().split())
print(((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5)

### FIXED CODE ###

x1, y1, x2, y2 = map(float, input().split())
print(((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5)
if __name__ == '__main__':
    s = input()
    K = int(input())

    subs = []
    for i in range(len(s)):                                                                                                                                                   for j in range(K):
            try:
                subs.append(s[i:i+j+1])
            except:
                break
    subs = set(subs)
    print(sorted(list(subs))[K-1])

### FIXED CODE ###

if __name__ == '__main__':
    s = input()
    K = int(input())

    subs = []
    for i in range(len(s)):
      for j in range(K):
            try:
                subs.append(s[i:i+j+1])
            except:
                break
    subs = set(subs)
    print(sorted(list(subs))[K-1])
import math

def C(m,n):
    return math.factorial(m)//math.factorial(n)//math.factorial(m-n)

N,K = map(int,input().split())
for i in range(1,K+1):
    print(int(C(K-1,i-1)*C(N-K+1,i))%(10**9+7))

### FIXED CODE ###

import math

def C(m,n):
    return math.factorial(m)//math.factorial(n)//math.factorial(m-n)

N,K = map(int,input().split())
for i in range(1,K+1):
    if N-K+1>=i:
        print(int(C(K-1,i-1)*C(N-K+1,i))%(10**9+7))
    else:
        print(0)
# -*- coding: utf-8 -*-

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

ans = []
for i in range(1, max(a,b)):
    if a%i==0 and b%i==0:
        ans.append(i)

#print(ans)

t = len(ans)-k
print(ans[t])


### FIXED CODE ###

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

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

ans = []
for i in range(1, max(a,b)+1):
    if a%i==0 and b%i==0:
        ans.append(i)

#print(ans)

t = len(ans)-k
print(ans[t])
A, B = map(int, input())
if (A+B)%2==0:
  print((A+B)/2)
else:
  print('IMPPOSSIBLE') 

### FIXED CODE ###

A, B = map(int, input().split())
if (A+B)%2==0:
  print(int((A+B)/2)) 
else:
  print('IMPOSSIBLE')
A,B,K  = map(int, input().split(" "))
count = 0
i = 1
tempList = []
for i in range(1,max(A,B)) :
    if A%i == 0 and B%i == 0:
        tempList.append(i)
print(tempList[-K])
    

### FIXED CODE ###


A,B,K  = map(int, input().split(" "))
count = 0
i = 1
tempList = []
for i in range(1,200) :
    if A%i == 0 and B%i == 0:
        tempList.append(i)
print(tempList[-K])
i = list(map(int, input().split()))
limit = int(input())
k = 0
while not i[0] < i[1] < i[2]:
    if i[2] <= i[1]:
        i[2] *= 2
        k += 1
    if k == limit:
        break
    if i[1] <= i[0]:
        i[1] *= 2
        k += 1
    if k == limit:
        break
if k <= limit and i[0] < i[1] < i[2]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

i = int(input())
k = 10 - int((i / 200))
print(k)
def visit_tree(now, num):
    if now >= len(visited):
        return 0
    if not visited[now]:
        visited[now] = num
        for i in range(len(tree[now])):
            visit_tree(tree[now][i], num)

n, m = map(int, input().split())
tree = [[] for _ in range(n)]
for i in range(m):
    x, y, z = map(int, input().split())
    tree[x - 1].append(y - 1)
    tree[y - 1].append(x - 1)

visited = [0 for _ in range(n)]
num = 0
for i in range(n):
    if not visited[i]:
        num += 1
        visit_tree(i, num)

print(num)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)

def visit_tree(now, num):
    visited[now] = num
    for i in range(len(tree[now])):
        if not visited[tree[now][i]]:
            visit_tree(tree[now][i], num)

n, m = map(int, input().split())
tree = [[] for _ in range(n)]
for i in range(m):
    x, y, z = map(int, input().split())
    tree[x - 1].append(y - 1)
    tree[y - 1].append(x - 1)

visited = [0 for _ in range(n)]
num = 0
for i in range(n):
    if not visited[i]:
        num += 1
        visit_tree(i, num)

print(num)
import math

my_value = int(input())

print("{} {}".format(pow(my_value, 2) * math.pi, 2 * math.pi * my_value))

### FIXED CODE ###

import math

my_value = float(input())

print("{} {}".format(pow(my_value, 2) * math.pi, 2 * math.pi * my_value))
import math
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**6)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

a,b = MAP()

print(a*b//math.gcd(a,b))

### FIXED CODE ###

import fractions
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**6)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

a,b = MAP()

print(a*b//fractions.gcd(a,b))
import fractions
n,m = map(int,input().split())
l = input().split()
lcm = 1
sum = 0
for i in range(len(l)):
    lcm = (int(l[i]) * lcm) // fractions.gcd(int(l[i]), lcm)
    sum += int(l[i]) % 2

if sum == len(l) or sum == 0:
    x = m // (int(lcm) / 2)
    y = m // lcm
    print(int(x - y))
else:
    print(0)

### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
 
def div_ceil(x, y): return (x + y - 1) // y
 
N, M = map(int, input().split())
*A, = map(int, input().split())
A = list(set([a // 2 for a in A]))
L = A[0]
for a in A[1:]:
    L *= a // gcd(L, a)
for a in A:
    if (L // a) % 2 == 0:
        ans = 0
        break
else:
    ans = div_ceil(M // L, 2)
print(ans)
import math

[a,b,h,m] = [int(x) for x in input().split(" ")]

short = (h*60+m)/(12*60)*360
long = (m)/(60)*360
theta = min(abs(long-short),abs(360-abs(short-long)))

print( math.sqrt (a*2+b*2+a*b*math.cos(math.radians(theta))))

### FIXED CODE ###

import math
 
[a, b, h, m] = [int(x) for x in input().split(" ")]
short = ((h) * 60 + m) / (12 * 60) * 360
long = (m) / (60) * 360
theta = abs(long - short)
inte = math.cos(math.radians(theta))
print(math.sqrt(a ** 2 + b ** 2- 2*a * b * inte))
N ,M = map(int, input().split())
ps = [list(input().split()) for i in range(M)]

ac = [0 for i in range(N)]
wa = [0 for i in range(N)]

for i in range(M):
    s = int(ps[i][0])-1
    if ps[i][1] == "WA" and ac[s] == 0:
        wa[s] += 1

    if ps[i][1] == "AC" and ac[s] == 0:
        ac[s] = 1

for i in range(M):
    if ac[i] == 0:
        wa[i] = 0

print(str(sum(ac)) + " " + str(sum(wa)))


### FIXED CODE ###

N ,M = map(int, input().split())
ps = [list(input().split()) for i in range(M)]

ac = [0 for i in range(N)]
wa = [0 for i in range(N)]

for i in range(M):
    s = int(ps[i][0])-1
    if ps[i][1] == "WA" and ac[s] == 0:
        wa[s] += 1

    if ps[i][1] == "AC" and ac[s] == 0:
        ac[s] = 1

for i in range(N):
    if ac[i] == 0:
        wa[i] = 0

print(str(sum(ac)) + " " + str(sum(wa)))
import math
from collections import Counter
N = int(input())
A_B = []
mod = 1000000007
for _ in range(N):
    A, B = map(int, input().split())
    if A < 0:
        A = -A
        B = -B
    C = math.gcd(abs(A), abs(B))
    A_B.append((A//C, B//C))
A_B_C = Counter(A_B)


hate_couple = 0
ans = 1
Done = set([])
for key, value in A_B_C.items():
    if key in Done:
        continue
    keya, keyb = key
    a = 0
    if keyb < 0:
        keya = -keya
        keyb = -keyb
    if (keyb, -keya) not in A_B_C:
        a = pow(2, value, mod)
    else:
        a = (pow(2, value, mod) - 1) + (pow(2, A_B_C[(keyb, -keya)], mod) - 1) + 1
        Done.add((keyb, -keya))
    ans *= a
    ans %= mod
    Done.add(key)

print((ans - 1)%mod)

### FIXED CODE ###

import math
from collections import Counter

N = int(input())
A_B = []
mod = 1000000007
for _ in range(N):
    A, B = map(int, input().split())
    if (A == 0) and (B == 0):
        A_B.append((A, B))
    elif A == 0:
        A_B.append((0, -1))
    elif B == 0:
        A_B.append((1, 0))
    else:
        if A < 0:
            A = -A
            B = -B
        C = math.gcd(abs(A), abs(B))
        A_B.append((A // C, B // C))

A_B_C = Counter(A_B)


ans = 1
Done = set([])
Done.add((0, 0))
for key, value in A_B_C.items():
    if key in Done:
        continue
    keya, keyb = key
    a = 0
    if keya == 0 and keyb == 0:
        a = value + 1
        Done.add((0, 0))
    else:
        if keyb < 0:
            keya = -keya
            keyb = -keyb
        if (keyb, -keya) not in A_B_C:
            a = pow(2, value, mod)
        else:
            a = (pow(2, value, mod) - 1) + (pow(2, A_B_C[(keyb, -keya)], mod) - 1) + 1
            Done.add((keyb, -keya))
    ans *= a
    ans %= mod
    Done.add(key)
ans -= 1
ans += A_B_C[(0, 0)]

print(ans % mod)
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
AB.sort()

q = []
idx = 0
ans = 0
for i in range(1, M+1):
    while idx < N:
        a, b = AB[idx]
        if a <= i:
            heapq.heappush(q, -b)
            idx += 1
        else:
            break
    if len(q) > 0:
        b = heapq.heappop(q)
        ans -= b

print(ans)

### FIXED CODE ###

import heapq
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
AB.sort()

q = []
idx = 0
ans = 0
for i in range(1, M+1):
    while idx < N:
        a, b = AB[idx]
        if a <= i:
            heapq.heappush(q, -b)
            idx += 1
        else:
            break
    if len(q) > 0:
        b = heapq.heappop(q)
        ans -= b

print(ans)