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

H,W=map(int,input().split())
S=[]
for h in range(H):
    Sh=list(input())
    S.append(Sh)
    
L=[[0 for w in range(W)] for h in range(H)]
R=[[0 for w in range(W)] for h in range(H)]
U=[[0 for w in range(W)] for h in range(H)]
D=[[0 for w in range(W)] for h in range(H)]

for h in range(H):
    a=0
    for w in range(W):
        if S[h][w]=='.':
            a+=1
        else:
            a=0
        L[h][w]+=a

for h in range(H):
    a=0
    for w in range(W):
        if S[h][-(1+w)]=='.':
            a+=1
        else:
            a=0
        R[h][-(1+w)]+=a

for w in range(W):
    a=0
    for h in range(H):
        if S[h][w]=='.':
            a+=1
        else:
            a=0
        U[h][w]+=a
    
for w in range(W):
    a=0
    for h in range(H):
        if S[-(1+h)][w]=='.':
            a+=1
        else:
            a=0
        D[-(1+h)][w]+=a

maxScore=0
for h in range(H):
    for w in range(W):
        score=L[h][w]+R[h][w]+U[h][w]+D[h][w]-3
        if score>maxScore:
            maxScore=score

print(maxScore)

### FIXED CODE ###

import numpy as np
H,W=map(int,input().split())
S=[list(input()) for h in range(H)]
S=[[1 if s=='.' else 0 for s in S[h]] for h in range(H)]
S=np.array(S)
L=S.copy()
R=S.copy()
U=S.copy()
D=S.copy()
for w in range(1,W):
    L[:,w]=(L[:,w-1]+1)*S[:,w]
    R[:,-(1+w)]=(R[:,-w]+1)*S[:,-(1+w)]
for h in range(1,H):
    U[h,:]=(U[h-1,:]+1)*S[h,:]
    D[-(1+h),:]=(D[-h,:]+1)*S[-(1+h),:]
print(int((L+R+U+D).max())-3)
### BUGGY CODE ###

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

DP = [0 for k in range(K+1)] #和がkとなる部分集合の数
DP[0] = 1
for a in A:
  for k in range(K-a,-1,-1):
    DP[k+a] += DP[k]

"""
for k in range(1,2*K+1): #累積和へ変換
  DP[k] += DP[k-1]
print(DP)
"""
"""
if sum(DP[0:K]) == 2**N:
  print(N)
  sys.exit()
"""
#print(DP)  
ans = 0
DP_rev = [0 for _ in range(K)] #戻すDP!!!
for a in A:
  flag = True
  if a >= K: break
  for i in range(K):
    DP_rev[i] = DP[i] 
    if i-a >= 0:
      DP_rev[i] -= DP_rev[i-a]
    if i >= K-a and DP_rev[i] > 0:
      #print(i,a)
      flag = False
      break
  if flag:
    ans += 1
  #print(a, DP_rev)
    
print(ans)
  
  
  
  


### FIXED CODE ###

import sys
N, K = map(int, input().split())
A = list(map(int, input().split()))
#A = [i for i in range(1,2)] + [i for i in range(2,1001)] * 4
A.sort()

DP = [0 for k in range(K+1)] #和がkとなる部分集合の数
DP[0] = 1
for a in A:
  for k in range(K-a,-1,-1):
    DP[k+a] += DP[k]

"""
for k in range(1,2*K+1): #累積和へ変換
  DP[k] += DP[k-1]
print(DP)
"""
"""
if sum(DP[0:K]) == 2**N:
  print(N)
  sys.exit()
"""
#print(DP)  


def det(t):
  a = A[t]
  if a >= K:
    return False
  DP_rev = [0 for _ in range(K)] #戻すDP!!!
  ans = True
  for i in range(K):
    DP_rev[i] = DP[i] 
    if i-a >= 0:
      DP_rev[i] -= DP_rev[i-a]
    if i >= K-a and DP_rev[i] > 0:
      ans = False
      break
  del DP_rev
  return ans

lt = 0
rt = N-1
if not det(lt):
  print(0)
  sys.exit()
if det(rt):
  print(rt+1)
  sys.exit()

while rt - lt > 1:
  ct = (lt + rt) // 2
  if det(ct):
    lt = ct
  else:
    rt = ct
print(rt)
### BUGGY CODE ###

def check(first, second, third, num_list):
    first_flag = False
    second_flag = False
    third_flag = False
    for num in num_list:
        if first_flag:
            if second_flag:
                if third_flag:
                    return True
                else:
                    if str(num) == third:
                        third_flag = True
            else:
                if str(num) == second:
                    second_flag = True
        else:
            if str(num) == first:
                first_flag = True
        if first_flag and second_flag and third_flag:
            return True
    return False

n = int(input())
s = input()
sl = list(s)

ans = 0

for i in range(1000):
    if i < 10:
        flag = check('0', '0', str(i), sl)
    elif i < 100:
        flag = check('0', str(i//10), str(i%10), sl)
    else:
        flag = check(str(i//100), str((i%100)//10), str(i%10), sl)
        
    if flag:
        ans += 1

print(ans)

### FIXED CODE ###

def check(first, second, third, num_list):
    first_flag = False
    second_flag = False
    third_flag = False
    for num in num_list:
        if first_flag:
            if second_flag:
                if third_flag:
                    return True
                else:
                    if str(num) == third:
                        third_flag = True
            else:
                if str(num) == second:
                    second_flag = True
        else:
            if str(num) == first:
                first_flag = True
        if first_flag and second_flag and third_flag:
            return True
    return False

n = int(input())
s = input()
sl = list(s)

ans = 0

for i in range(1000):
    if i < 10:
        flag = check('0', '0', str(i), sl)
    elif i < 100:
        flag = check('0', str(i//10), str(i%10), sl)
    else:
        flag = check(str(i//100), str((i%100)//10), str(i%10), sl)
        
    if flag:
        ans += 1

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

# C
import numpy as np

inp = input().split(' ')
N, M = int(inp[0]), int(inp[1])

inps = input().split(' ')
H = np.array([int(inps[i]) for i in range(len(inps))])
AB = []
for i in range(M):
    inps = input().split(' ')
    AB.append(set([int(inps[0]), int(inps[1])]))
    
def get_height(els):
    return H[els[0]-1] > H[els[1]-1]

def get_height_sum(arr):
    if not arr:
        return 1
    return np.prod(list(map(get_height, arr)))

def tmp(arr_arr):
    return sum(list(map(get_height_sum, arr_arr)))

connected = [[[i+1] + list(ab - {i+1}) for ab in AB if i+1 in ab] for i in range(N)]

print(int(tmp(connected)))

### FIXED CODE ###

# C
N, M = map(int, input().split())
H = list(map(int, input().split()))

A = [0] * N
for i in range(M):
    a, b = map(int, input().split())
    A[a-1] = max(A[a-1], H[b-1])
    A[b-1] = max(A[b-1], H[a-1])
    
res = sum([H[i] > A[i] for i in range(N)])
print(res)
### BUGGY CODE ###

H, W, D = [int(x) for x in input().split()]
A = [0] * (H * W + 1)
for h in range(H):
    inp = [int(x) for x in input().split()]
    for i, a in enumerate(inp):
        A[a] = (i + 1, h + 1)

table = [[-1] * (H * W + 1) for x in range(H * W + 1)]

def calc(table, l, r):
    if l == r:
        return 0
    if table[l][r] != -1:
        return table[l][r]
    m_ = abs(A[l+D][0] - A[l][0]) + abs(A[l+D][1] - A[l][1])
    ret = m_ + calc(table, l + D, r)
    table[l][r] = ret
    return ret

Q = int(input())
for q in range(Q):
    l, r = [int(x) for x in input().split()]
    print(calc(table, l, r))


### FIXED CODE ###

H, W, D = [int(x) for x in input().split()]
A = [0] * (H * W + 1)
for h in range(H):
    inp = [int(x) for x in input().split()]
    for i, a in enumerate(inp):
        A[a] = (i + 1, h + 1)

table = [0] * (H * W + 1)
for i in range(D):
    x = H * W - i - D
    r = 0
    while x > 0:
        table[x] = abs(A[x][0] - A[x+D][0]) + abs(A[x][1] - A[x+D][1]) \
                   + r
        r = table[x]
        x -= D
for q in range(int(input())):
    l, r = [int(x) for x in input().split()]
    print(table[l] - table[r])
### BUGGY CODE ###

#!/mnt/c/Users/moiki/bash/env/bin/python
N = int(input())
A = list(map(int, input().split()))
B = sorted(list(map(int, input().split())))

from bisect import bisect_left, bisect_right
from copy import copy

ans = 0
for k in range(38):
    mod = 2**(k+1)
    T = 2**k
    B_sub = [ [], [] ]
    for b in B:
        B_sub[ (b & (1<<k))>>k].append(b)

    B = sum(B_sub, [])
    # print(B)
    # Bcopy = copy(B)
    Bcopy = list(map(lambda x: x%mod, B))

    count = 0
    for a in A:
        a = a % mod
        i1 = bisect_left(Bcopy, T-a)
        i2 = bisect_right(Bcopy, 2*T-a-1 )
        i3, i4 = bisect_left(Bcopy, 3*T-a), \
                 bisect_right(Bcopy, 4*T-a-1)
        count += i2 - i1 + i4 - i3
        # print("T: {}, a: {} , i1,i2,i3,i4: {}, Bcopycopy: {}, T-a: {}, 2*T-a: {}".format(T,a, [i1,i2,i3,i4], Bcopy,
        #          T-a, 2*T-a))
    if not count % 2 == 0:
        ans |= 1<<k
print(ans)
        


### FIXED CODE ###

#!/mnt/c/Users/moiki/bash/env/bin/python
N = int(input())
A = list(map(int, input().split()))
B = sorted(list(map(int, input().split())))

from bisect import bisect_left, bisect_right
from copy import copy

ans = 0
for k in range(38):
    mod = 2**(k+1)
    T = 2**k
    A_sub = [ [], [] ]
    B_sub = [ [], [] ]
    for a in A:
        A_sub[ (a & (1<<k))>>k].append(a)
    for b in B:
        B_sub[ (b & (1<<k))>>k].append(b)

    A = sum(A_sub, [])
    B = sum(B_sub, [])

    itr = [N]*4
    count = 0
    mask = 2**(k+1)-1
    amask = [ai & mask for ai in A]
    bmask = [bi & mask for bi in B]
    for ai in amask:
        border = [
                T - ai,
                2*T - ai,
                3*T - ai,
                4*T - ai]
        for i in range(4):
            while 0 < itr[i]  and border[i] <= bmask[itr[i]-1]:
                itr[i] -= 1
        count += (itr[1] - itr[0]) + (itr[3]) - (itr[2])


    # Bcopy = list(map(lambda x: x%mod, B))

    # count = 0
    # for a in A:
    #     a = a % mod
    #     i1 = bisect_left(Bcopy, T-a)
    #     i2 = bisect_right(Bcopy, 2*T-a-1 )
    #     i3, i4 = bisect_left(Bcopy, 3*T-a), \
    #              bisect_right(Bcopy, 4*T-a-1)
    #     count += i2 - i1 + i4 - i3
    #     # print("T: {}, a: {} , i1,i2,i3,i4: {}, Bcopycopy: {}, T-a: {}, 2*T-a: {}".format(T,a, [i1,i2,i3,i4], Bcopy,
    #     #          T-a, 2*T-a))
    if not count % 2 == 0:
        ans |= 1<<k
print(ans)
### BUGGY CODE ###


import collections


def main():
    k = int(input())
    kList = [0] * 10 ** 6
    cnt = 0
    if k % 2 == 0:
        print(-1)
        return
    for i in range(10000000):
        cnt += 1
        kList[i] = ((kList[max(0, i - 1)] + 7 * 10 ** (cnt - 1)) % k)
        if kList[i] == 0:
            break
    print(cnt)


def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy > 0:
        out = str(X_dumy % n)+out
        X_dumy = int(X_dumy/n)
    return out


def is_prime(q):
    q = abs(q)
    if q == 2:
        return True
    if q < 2 or q & 1 == 0:
        return False
    return pow(2, q-1, q) == 1


if __name__ == '__main__':
    main()


### FIXED CODE ###


import collections


def main():
    k = int(input())
    a = 0
    ans = -1
    for i in range(1, 2 * 10 ** 6):
        a = 10 * a + 7
        a %= k
        if a == 0:
            ans = i
            break
    print(ans)


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

n,k=map(int,input().split())
ans=[0 for _ in range(n*3)]
ans[1]=1

idou=[]

for _ in range(k):
  a=list(map(int,input().split()))
  idou.append(a)
  
    
mod=998244353

rui=[0 for _ in range(n+1)]
rui[1]=1
  
for i in range(2,n+1):
  for g in idou:
    x,y=g
    left=max(0,i-y-1)
    right=max(0,i-x)
    ans[i]+=rui[right]-rui[left]

    
  rui[i]+=((rui[i-1]+ans[i]))

    
    

print(ans[n]%mod)
  

### FIXED CODE ###

n,k=map(int,input().split())
ans=[0 for _ in range(n*3)]
ans[1]=1

idou=[]

for _ in range(k):
  a=list(map(int,input().split()))
  idou.append(a)
  
    
mod=998244353

rui=[0 for _ in range(n+1)]
rui[1]=1
  
for i in range(2,n+1):
  for g in idou:
    x,y=g
    left=max(0,i-y-1)
    right=max(0,i-x)
    ans[i]+=(rui[right]-rui[left])%mod

    
  rui[i]+=((rui[i-1]+ans[i]))%mod

    
    

print(ans[n]%mod)
### BUGGY CODE ###

N,K = list(map(int, input().split()))
p = list(map(int, input().split()))
max = 0

for i in range(N-K+1):
    tmp = (sum((p[i:i+K]))+K)*0.5
    if max < tmp :
        max = tmp
print('{:.12f}'.format(max))


### FIXED CODE ###

N,K = list(map(int, input().split()))
p = list(map(int, input().split()))
p2 = [p[i]*0.5 + 0.5 for i in range(N)]
size = N + 1
cusum = [0] * size
max = 0

for i in range(N):
    cusum[i+1] = cusum[i] + p2[i]

for i in range(N-K+1):
    tmp = cusum[i+K] - cusum[i]
    if max < tmp:
        max = tmp
print(max)
### BUGGY CODE ###

N=list(input())
ans=[0]*len(N)
for i in range(len(N)):
   ing=N[i]
   if ing=="R":
      for j in range(i+1,len(N)):
         if N[j] == "L":
            if (j-i)%2==0:
               ans[j]+=1
               break
            else:
               ans[j-1]+=1
               break
   elif ing=="L":
      for j in reversed(range(0,i)):
         if N[j] == "R":
            if (i-j)%2==0:
               ans[j]+=1
               break
            else:
               ans[j+1]+=1
               break
ans=list(map(str,ans))
print(" ".join(ans))

### FIXED CODE ###

l=input()
ans=[0]*len(l)
l=l.replace("RL","X")
cnt=0
now=l[0]
l2=[]
r_c=0
for i in l:
   if now != i:
      l2.append((now,cnt))
      now=i
      cnt=1
   else:
      cnt+=1
l2.append((now,cnt))
now=0
for i,j in l2:
   if i == "R":
      now+=j
      r_c=j
   elif i == "L":
      ans[now-2]+=j//2+j%2
      ans[now-1]+=j//2
      now+=j
   if i == "X":
      ans[now+1]+=r_c//2+r_c%2
      ans[now]+=r_c//2
      r_c=0
      for k in range(j):
         ans[now]+=1
         ans[now+1]+=1
         now+=2
print(*ans)
### BUGGY CODE ###

import numpy as np

H, W, D = map(int, input().split())
A = []

for _ in range(H):
    A.append(list(map(int, input().split())))

A = np.array(A)
    
Q = int(input())

for _ in range(Q):
    L, R = map(int, input().split())
    
    to_be_checked = [i for i in range(L, R+1, D)]
    
    if L == R:
        print(0)
    else:
        mask = np.in1d(A, to_be_checked).reshape(A.shape[0], A.shape[1])
        idx_x, idx_y = np.where(mask == True)
        order = np.argsort(A[idx_x, idx_y])
        idx_x = idx_x[order]
        idx_y = idx_y[order]

        MP = sum([np.absolute(idx_x[i] - idx_x[i+1]) for i in range(len(idx_x)-1)]) + sum([np.absolute(idx_y[i] - idx_y[i+1]) for i in range(len(idx_y)-1)])

        print(MP)

### FIXED CODE ###

H, W, D = map(int, input().split())
pos = [None]*(H*W)

for i in range(H):
    row = list(map(int, input().split()))
    for j in range(W):
        pos[row[j]-1] = (i, j)

costs = [0]*(H*W)
for i in range(1, D+1):
    current = i + D
    while current <= H*W:
        costs[current - 1] = costs[current - 1 - D] + abs(pos[current - 1][0] - pos[current - 1 - D][0]) + abs(pos[current - 1][1] - pos[current - 1 - D][1])
        current += D

Q = int(input())
for _ in range(Q):
    L, R = map(int, input().split())
    MP = costs[R-1] - costs[L-1]
    print(MP)
### BUGGY CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	D
# CreatedDate:  2020-08-18 14:44:25 +0900
# LastModified: 2020-09-11 15:30:45 +0900
#


import os
import sys


def pivot_index(change_box, i, which):
    if which == 0:
        for cb in change_box:
            if cb >= i:
                return cb
    else:
        for j in range(len(change_box)-1, -1, -1):
            if change_box[j] <= i:
                return change_box[j]


def main():
    S = input()
    change_box = []
    floor_chart = 1
    i = 0
    while i < len(S)-1:
        if S[i] != S[i+1] and floor_chart == 1:
            floor_chart = 0
            change_box.append(i)
        elif S[i] != S[i+1] and floor_chart == 0:
            floor_chart = 1
        i += 1

    ans = [0]*len(S)
    omit = 0
    for i in range(len(S)):
        if S[i] == 'R':
            if omit == 0:
                pidx = pivot_index(change_box, i, 0)
                omit = 1
            cool = pidx - i
            if cool % 2 == 0:
                ans[pidx] += 1
            else:
                ans[pidx+1] += 1

        else:
            if omit == 1:
                pidx = pivot_index(change_box, i, 1)+1
                omit = 0
            cool = i - pidx
            if cool % 2 == 0:
                ans[pidx] += 1
            else:
                ans[pidx-1] += 1
    print(ans[0], end='')
    for i in range(1, len(ans)):
        print(" {}".format(ans[i]), end='')
    print()


if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	D
# CreatedDate:  2020-08-18 14:44:25 +0900
# LastModified: 2020-09-11 15:35:56 +0900
#


import os
import sys


def pivot_index(change_box, i, which):
    if which == 0:
        for cb in change_box:
            if cb >= i:
                return cb
    else:
        for j in range(len(change_box)-1, -1, -1):
            if change_box[j] <= i:
                return change_box[j]


def main():
    S = input()
    change_box = []
    floor_chart = 1
    i = 0
    while i < len(S)-1:
        if S[i] != S[i+1] and floor_chart == 1:
            floor_chart = 0
            change_box.append(i)
        elif S[i] != S[i+1] and floor_chart == 0:
            floor_chart = 1
        i += 1

    ans = [0]*len(S)
    one_cool = 0
    hash_one = 0
    for i in range(len(S)):
        if S[i] == 'R':
            if hash_one == 1:
                hash_one = 0
                one_cool += 1
            pidx = change_box[one_cool]
            cool = pidx - i
            if cool % 2 == 0:
                ans[pidx] += 1
            else:
                ans[pidx+1] += 1

        else:
            pidx = change_box[one_cool]+1
            hash_one = 1
            cool = i - pidx
            if cool % 2 == 0:
                ans[pidx] += 1
            else:
                ans[pidx-1] += 1
    print(ans[0], end='')
    for i in range(1, len(ans)):
        print(" {}".format(ans[i]), end='')
    print()


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

import numpy as np
n, k = map(int, input().split())
A = list( map(int, input().split()))
F = list( map(int, input().split())) 
A = sorted(A)
F = sorted(F, reverse = True)
A = np.array(A)
F = np.array(F)

af = A*F


while k > 0:
    maxIndex = [i for i, x in enumerate(af) if x == max(af)]
    if k >= len(maxIndex):
        af[maxIndex] -= F[maxIndex]
        k -= len(maxIndex)

    else:
        break

print(np.max(af))

### FIXED CODE ###

n, k = map(int, input().split())
A = list( map(int, input().split()))
F = list( map(int, input().split())) 
A = sorted(A)
F = sorted(F, reverse = True)

def isok(ans):
    k_ = 0
    for a,f in zip(A,F):
        if a > ans//f:
            k_ += a - ans//f
            if k_ > k:
                return False
    return True

ok = max(A)*max(F)
ng = 0

while ok - ng >= 1:
    m = (ok+ng)//2
    if ok - ng == 1:
        if isok(ng):
            ok = ng
            break
        break
    if isok(m):
        ok = m
    else:
        ng = m
print(ok)
### BUGGY CODE ###

from heapq import heappush, heappop
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
pq = []
for i, b in enumerate(B):
    heappush(pq, (-b, i))
ans = 0
while pq:
    _, i = heappop(pq)
    B[i] -= B[(i-1) % N] + B[(i+1) % N]
    if B[i] < A[i]:
        ans = -1
        break
    if B[i] > A[i]:
        heappush(pq, (-B[i], i))
    ans += 1
print(ans)

### FIXED CODE ###

from heapq import heappush, heappop
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
pq = []
for i, b in enumerate(B):
    if A[i] != b:
        heappush(pq, (-b, i))
ans = 0
while pq:
    _, i = heappop(pq)
    s = B[(i-1) % N] + B[(i+1) % N]
    q, r = divmod(B[i] - A[i], s)
    B[i] = A[i] + r
    ans += q
    if q == 0:
        ans = -1
        break
    if B[i] > A[i]:
        heappush(pq, (-B[i], i))
print(ans)
### BUGGY CODE ###

import numpy as np

from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall


def solve():
    N = int(input())
    A = np.array([input().split() for _ in range(N)], dtype=np.int64).reshape(N, N)
    
    B = floyd_warshall(csr_matrix(A), directed=False)
    
    if np.any(B < A):
        print(-1)
        exit()
    
    np.fill_diagonal(B, np.inf)
    for i in range(N - 1):
        for j in range(i + 1, N):
            for k in range(N):
                if B[i][j] == B[i][k] + B[k][j]:
                    A[i][j] = A[j][i] = 0
    print(np.sum(A) // 2)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import numpy as np

from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall


def solve():
    N = int(input())
    A = np.array([input().split() for _ in range(N)], dtype=np.int64).reshape(N, N)
    
    B = floyd_warshall(csr_matrix(A), directed=False)
    
    if np.any(B < A):
        print(-1)
        exit()
    
    np.fill_diagonal(B, np.inf)
    for i in range(N - 1):
        for j in range(i + 1, N):
            if B[i][j] == np.min(B[i] + B[j]):
                A[i][j] = A[j][i] = 0
    print(np.sum(A) // 2)


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

s = input()
k,counter,n = int(input()),0,0
while counter < len(s):
    if s[counter] == "1":
        n += 1
    counter += 1
if n == len(s):
    print(1)
else:
    counter = 0
    while counter < k:
        if s[counter] != "1":
            print(s[counter])
            break

### FIXED CODE ###

s = input()
k = int(input())
for c in range(min(len(s),k)):
    if s[c] != "1":
        print(s[c])
        exit()
print(1)
### BUGGY CODE ###

input_n = input()
N = int(input_n)

check_list = ['AC', 'WA', 'TLE', 'RE']
count_list = [0, 0, 0, 0]

for i in range(N):
    flag = 0
    Si = input()
    while flag<4:
        if Si==check_list[flag]:
            count_list[flag] += 1
        else:
            flag += 1

print('AC  x  '+count_list[0])
print('WA  x  '+count_list[1])
print('TLE  x  '+count_list[2])
print('RE  x  '+count_list[3])

### FIXED CODE ###

input_n = input()
N = int(input_n)

# S_list = [input() for i in range(N)]
check_list = ['AC', 'WA', 'TLE', 'RE']
count_list = [0, 0, 0, 0]

for i in range(N):
    flag = 0
    S = input()
    while flag<4:
        if S==check_list[flag]:
            count_list[flag] += 1
            break;
        else:
            flag += 1

print('AC  x  '+ str(count_list[0]))
print('WA  x  '+ str(count_list[1]))
print('TLE  x  '+ str(count_list[2]))
print('RE  x  '+ str(count_list[3]))
### BUGGY CODE ###

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

Ali.sort()

Alis = set(Ali)
Blis = set(Ali)

for el in Alis:
  if Ali.count(el) > 1:
    Blis.remove(el)

Alis = Blis

for i in range(N):
  Alis.difference_update(range(Ali[i]*2, Ali[-1]+1, Ali[i]))
  
print(len(Alis))

### FIXED CODE ###

N = int(input())
Ali = list(map(int,input().split()))
Alis = set()
Blis = set()

Ali.sort()

for i in range(N):
  if Ali[i] in Alis:
    Blis.add(Ali[i])
    continue
  Alis.add(Ali[i])

Alis -= Blis

for i in range(N):
  Alis.difference_update(range(Ali[i]*2, Ali[-1]+1, Ali[i]))
  
print(len(Alis))