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

import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
#import numpy as np
def main():
    n, *a = map(int, read().split())

    if 1 in a:
        count1 = a.count(1)
        if count1 == 1:
            print(1)
            sys.exit()
        else:
            print(0)
            sys.exit()
    a.sort()
    res = [1] * n
    for i1 in range(n):
        ae = a[i1]
        for i2 in range(i1+1, n):
            if a[i2] == ae:
                res[i1] = 0
                res[i2] = 0
            elif a[i2] % ae == 0:
                res[i2] = 0
    print(sum(res))

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n = int(input())
    a = list(map(int, input().split()))

    a.sort()
    tf = [0] * (a[-1] + 1)
    for ea in a:
        tf[ea] = 1
    for i1 in range(n - 1):
        if a[i1] == a[i1 + 1]:
            tf[a[i1]] = 0

        for i2 in range(2, a[-1]//a[i1] + 1):
            tf[a[i1] * i2] = 0
    r = sum(tf)
    print(r)


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



def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    
    def pcnt(X):
        st=str(bin(X))
        return st.count("1")
    
    def calc(X):
        if X==0:
            return 0
        cnt=0
        while X!=0:
            #print(X,pcnt(X))
            X=X%pcnt(X)
            cnt+=1
        return cnt
    
    N=I()
    Xst=input()
    a=Xst.count("1")
    X=int(Xst,2)
    
    for i in range(N):
        if Xst[i]=="0":
            xa=a+1
            X2=X+(1<<(N-i-1))
        else:
            xa=a-1
            X2=X-(1<<(N-i-1))
        cnt=0
        #print(X2,xa)
        if X2!=0:
            X2=X2%xa
            cnt=1+calc(X2)
        print(cnt)
    
    
        

main()


### FIXED CODE ###



def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    def popcount(x):
        '''xの立っているビット数をカウントする関数
        (xは64bit整数)'''

        # 2bitごとの組に分け、立っているビット数を2bitで表現する
        x = x - ((x >> 1) & 0x5555555555555555)

        # 4bit整数に 上位2bit + 下位2bit を計算した値を入れる
        x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)

        x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f # 8bitごと
        x = x + (x >> 8) # 16bitごと
        x = x + (x >> 16) # 32bitごと
        x = x + (x >> 32) # 64bitごと = 全部の合計
        return x & 0x0000007f
    
    N=I()
    Xst=input()
    
    #メモ化
    dp=[0]*(N+5)
    for i in range(1,N+5):
        X=i
        X=X%popcount(X)
        dp[i]=dp[X]+1 
       
    a=Xst.count("1")
    #a+1,a-1でしか割らない
    if a==0:
        for i in range(N):
            print(1)
        exit()
    elif a==1:
        for i in range(N):
            if Xst[i]=="1":
                print(0)
            else:
                if i!=(N-1):
                    print(1)
                else:
                    if Xst[-1]=="0":
                        print(2)
        exit()
    
    remp=[0]*(N+1)
    remm=[0]*(N+1)
    
    remp[0]=1%(a+1)
    remm[0]=1%(a-1)
    
    for i in range(1,N+1):#
        remp[i]=(2*remp[i-1])%(a+1)
        remm[i]=(2*remm[i-1])%(a-1)
    
    Xremp=0
    Xremm=0
    for i in range(N):
        if Xst[i]=="1":
            Xremp+=remp[N-i-1]
            Xremm+=remm[N-i-1]
    Xremp%=(a+1)
    Xremm%=(a-1)
    
    #print(Xremp,Xremm)
    
    for i in range(N):
        if Xst[i]=="0":
            Xrem2=(Xremp+remp[N-i-1])%(a+1)
        else:
            Xrem2=(Xremm-remm[N-i-1])%(a-1)
        
        print(dp[Xrem2]+1)
    
    
    
        

main()
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
for k in range(N):
    x = A[0] ^ B[0]
    if all(a ^ b == x for a, b in zip(A[1:], B[1:])):
        print(k, x)
    A[:] = A[1:] + [A[0]]

### FIXED CODE ###

class KMP:
    def __init__(self, P):
        self.P = P
        self.N = len(P)
        self.T = [0] * (self.N + 1)
        self._compile()

    def _compile(self):
        j = 0
        self.T[0] = -1
        for i in range(1, self.N):
            self.T[i] = j
            j += 1 if self.P[i] == self.P[j] else -j
        self.T[self.N] = j

    def search(self, S):
        NS = len(S)
        i = m = 0
        A = []
        while m + i < NS:
            if self.P[i] == S[m + i]:
                i += 1
                if i != self.N:
                    continue
                A.append(m)
            m += i - self.T[i]
            i = max(0, self.T[i])
        return A

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = [A[i]^A[(i+1)%N] for i in range(N)]
D = [B[i]^B[(i+1)%N] for i in range(N)]
C = C + C[:-1]
K = KMP(D).search(C)
for k in K:
    print(k, A[k]^B[0])
### BUGGY CODE ###

def main():
    n = int(input())
    flg=0
    f=1
    temp=n
    while temp > 0:
        f*=temp
        temp-=2
    a=str(f)
    cnt=0
    for i in range(1,n+1):
        if a[-i] == '0':
            cnt+=1
        else:
            break
    print(cnt)
if __name__=='__main__':
    main()


### FIXED CODE ###

def main():

    n = int(input())

    if n%2 == 1:
        print(0)
        return
    ans = 0
    n = n // 2

    while n>4:
        ans += n // 5
        n = n // 5

    print(ans)


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

N = int(input())
A = list(map(int,input().split()))
anser = 1
for i in A:
    anser *= i
if anser > 10 ** 18:
    print("-1")
else:
    print(anser)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
anser = 1
if 0 in A:
    print("0")
    exit()
for i in A:
    anser *= i
    if anser > 10 ** 18:
        print("-1")
        exit()
print(anser)
### BUGGY CODE ###

n=int(input())
a=list(map(int, input().split()))
import collections
import math
def combinations_count2(n):
    if(n<=1):
        answer=0
    else:
        answer=n*(n-1)/2
    return answer

table=collections.Counter(a)
keytable=table.keys()
c=[]

for key in keytable:
    c.append(table[key])
#print(c)
ca=[]
for j in range(len(c)):
    ca.append(combinations_count2(c[j]))
#print(ca)
sums=sum(ca)
#print(sum)
#print(keytable)
#print(table)
for i in range(len(a)):
    keynum=list(keytable).index(a[i])
    answer=sums-c[keynum]+1
    print(int(answer))

### FIXED CODE ###

n=int(input())
a=list(map(int, input().split()))
import collections
import math
def combinations_count2(n):
    if(n<=1):
        answer=0
    else:
        answer=n*(n-1)/2
    return answer

table=collections.Counter(a)
keytable=table.keys()
sums=0
for value in table.values():
    sums+=combinations_count2(value)
#print(ca)
#print(sum)
#print(keytable)
#print(table)
for i in range(len(a)):
    answer=sums-table[a[i]]+1
    print(int(answer))
### BUGGY CODE ###

import functools
import operator

N, K = map(int, input().split())
performance = list(map(int, input().split()))
performance_A = []

for i in range(0, N-K+1):
  performance_A.append(performance[i:i+K])

for i in range(len(performance_A)-1):
  if functools.reduce(operator.mul, performance_A[i]) < functools.reduce(operator.mul, performance_A[i+1]):
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

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

for i in range(n-k):
  if A[k+i] > A[i]:
    print("Yes")
  else:
    print("No")
### BUGGY CODE ###

def __logging(visited, rest=[]):
    if rest:
        print(' visited:'+str(visited)+'\n'+
              '    rest:'+str(rest)+'\n')
    else:
        print(' visited:'+str(visited))


def dfs(graph, start, visited):
    if visited[start] != -99999:
        return True
    
    stack = [(start, 0)]
    distance = []
    flag = True
    while stack:
        temp = stack.pop(0)
        label = temp[0]
        dis = temp[1]
        if visited[label] == -99999:
            tmp = graph[label]
            tmp = list(map(lambda x: (x[0], x[1] + dis), tmp))
            stack = tmp + stack
            visited[label] = dis
        else:
            if flag and dis != visited[label]:
                flag = False
        #__logging(visited, stack)
    return flag

N, M = (int(i) for i in input().split())  

graph = [[] for i in range(N+1)]

for i in range(M):
    L, R, D = (int(i) for i in input().split())
    graph[L].append((R, D))
    graph[R].append((L, -1 * D))


visited = [-99999 for i in range(N+1)]

flag = True
for i in range(N + 1):
    ans = dfs(graph, i, visited)
    if not ans:
        flag = False
        break

if flag:
    print('Yes')
else:
    print('No')


### FIXED CODE ###



def dfs(graph, start, visited):
    if visited[start] != -99999:
        return True
    
    stack = [start]
    visited[start] = 0
    while stack:
        label = stack.pop()
        for nextnode, distance in graph[label]:
            if visited[nextnode] == -99999:
                stack.append(nextnode)
                visited[nextnode] = visited[label] + distance
            elif visited[nextnode] != visited[label] + distance:
                return False
    return True

N, M = (int(i) for i in input().split())  

graph = [[] for i in range(N+1)]

for i in range(M):
    L, R, D = (int(i) for i in input().split())
    graph[L].append((R, D))
    graph[R].append((L, -1 * D))


visited = [-99999 for i in range(N+1)]

flag = True
for i in range(1, N + 1):
    ans = dfs(graph, i, visited)
    if not ans:
        flag = False
        break

if flag:
    print('Yes')
else:
    print('No')
### BUGGY CODE ###

#!/usr/bin/env python3
import sys
import numpy as np

def solve(N: int, L: "List[int]"):
    L = np.array(sorted(L))
    ct = 0
    for a in range(len(L)-2):
        for b in range(a+1, len(L)-1):
            ct+=(L[b+1:] < L[a]+L[b]).sum() 
            
    print(ct)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    L = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, L)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
# import numpy as np
import bisect

def solve(N: int, L: "List[int]"):
    L = sorted(L)
    ct = 0
    for a in range(len(L)-2):
        a_ = L[a]
        for b in range(a+1, len(L)-1):
            b_in = bisect.bisect_left(L,a_+L[b]) - b -1
            if b_in > 0:
                ct+=b_in

            # print("L :{} a+Lb :{}  b_in:{}".format(L[b+1:],a_+L[b],ct))
        # ct += sum([bisect.bisect_left(L[b+1:],a_+L[b]) for b in range(a+1, len(L)-1)])
    print(ct)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    L = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, L)

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

# D - Banned K
N = int(input())
A = list(map(int, input().split()))

import copy as c
C = []
for i in range(N):
    C.append(A.count(i+1))

for k in range(N):
    C_tmp = c.copy(C)
    if C_tmp[A[k]-1] > 0:
        sum=0
        C_tmp[A[k]-1] = C_tmp[A[k]-1]-1
        C_tmp2 = [s for s in C_tmp if s > 1]
        for j in C_tmp2:
            sum = sum + j*(j-1)/2
        #print(C_tmp,C_tmp2,int(sum))
        print(int(sum))
    else:
        sum=0
        C_tmp2 = [s for s in C if s > 1]
        print(C),print(C_tmp2)
        for j in C_tmp2:
            sum = sum + j*(j-1)/2
        #print(C,C_tmp2,int(sum))
        print(int(sum))

### FIXED CODE ###

import collections


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

    counter = collections.Counter(A)
    ans = 0

    for i in counter.values():
        ans += i * (i - 1) // 2

    for a in A:
        count = counter[a]
        print(ans - (count * (count - 1) // 2) +
              ((count - 1) * (count - 2) // 2))


resolve()
### BUGGY CODE ###

N,H = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]
AB_a = sorted(AB, reverse = True, key=lambda x: x[0])
AB_b = sorted(AB, reverse = True, key=lambda x: x[1])
damage = 0
count = 0
j = 0
while damage < H:
  if j < N:
    if AB_b[j][1] >= AB_a[0][0]:
      damage += AB_b[j][1]
      j += 1
    else:
      damage += AB_a[0][0]
  else:
    count += (H-damage)//AB_a[0][0]
    damage = H - (H-damage)%AB_a[0][0]
    if damage == H:
      break
    else:
      count += 1
      break
  count += 1
print(count)

### FIXED CODE ###

from bisect import bisect_left
N,H = map(int,input().split())
A = [0]*N
B = [0]*N

for i in range(N):
  a,b = map(int,input().split())
  A[i] = a
  B[i] = b

A = max(A)
B = sorted(B)

count,damage = 0,0
b = bisect_left(B,A)

for i in range(len(B)-1,b-1,-1):
  damage += B[i]
  count += 1
  if damage >= H:
    print(count)
    exit()

count,damage = 0,0
damage = sum(B[b:])
count += len(B[b:])
count += (H-damage)//A
damage = H - (H-damage)%A
if damage == H:
  pass
else:
  count += 1
print(count)
### BUGGY CODE ###

n = int(input())
ans = 1
a = []
a = input().split(" ")

for i in range(n):
  ans *= int(a[i])
  
if ans > 10**18:
  print("-1")
else:
  print(ans)

### FIXED CODE ###

n = int(input())
ans = int(1)
a = input().split(" ")

if "0" in a:
  ans = 0
else:
  for i in range(n):
    ans *= int(a[i])
    if ans > 10**18:
      print("-1")
      break
    
if ans <= 10**18:
  print(ans)
### BUGGY CODE ###

#

import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop

def main():
    n = int(input())
    agrid = []
    agrid_pointer = [0] * n
    aconditions = {}
    for i in range(n):
        al = list(map(int, input().split()))
        for j in range(len(al)):
            al[j] -= 1
        agrid.append(al)
        aconditions[i] = set(al)

    # print(agrid)
    # print(aconditions)

    ans = 0
    while True:
        match = set()
        for i in range(n):
            if len(aconditions[i]) == 0 or i in match:  # もう全部対戦済み or この日対戦済み
                continue

            target = agrid[i][agrid_pointer[i]]
            if len(aconditions[target]) == 0 or target in match:  # もう全部対戦済み or この日対戦済み
                continue

            if agrid[target][agrid_pointer[target]] != i:  # 次対戦できない
                continue

            # can match
            aconditions[i].remove(target)
            agrid_pointer[i] += 1

            aconditions[target].remove(i)
            agrid_pointer[target] += 1

            match.add(i)
            match.add(target)
            if len(match) == n or len(match) == n - 1:  # 全員試合することが決まったら
                break

        # print(match)
        if len(match) == 0:  # 対戦がなくなったら
            break
        ans += 1

    # print(aconditions)
    # 対戦が残ってたら
    for v in aconditions.values():
        if len(v) != 0:
            print(-1)
            return
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#
import sys
import time

def input(): return sys.stdin.readline().strip()

def main():
    n = int(input())
    agrid = []
    agrid_pointer = [0] * n

    start = time.time()

    for i in range(n):
        al = list(map(int, input().split()))
        agrid.append(al)

    ans = 0

    while True:
        match = set()
        for i in range(n):
            if agrid_pointer[i] == n - 1 or i in match:  # もう全部対戦済み or この日対戦済み
                continue

            target = agrid[i][agrid_pointer[i]] - 1
            if agrid_pointer[target] == n - 1 or target in match:  # もう全部対戦済み or この日対戦済み
                continue
            # i, target は対戦可能

            if agrid[target][agrid_pointer[target]] - 1 != i:
                continue

            # can match
            agrid_pointer[i] += 1
            agrid_pointer[target] += 1

            match.add(i)
            match.add(target)

            if len(match) == n or len(match) == n - 1:  # 全員試合することが決まったら
                break

        # print(match)
        if len(match) == 0:  # 対戦がなくなったら
            break
        elapsed_time = time.time() - start
        if elapsed_time > 1.5:
            print(n * (n-1)//2)
            return

        ans += 1

    # print(aconditions)
    # 対戦が残ってたら
    for p in agrid_pointer:
        if p != n - 1:
            print(-1)
            return
    print(ans)


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

import itertools

def f(n):
  m = int(n**0.5)
  count = 0
  for x, y, z in itertools.combinations_with_replacement(range(1, m+1), 3):
    if x**2+y**2+z**2+x*y+y*z+z*x==n:
      k = len(set({x, y, z}))
      if k == 1:
        count += 1
      elif k == 2:
        count += 3
      else:
        count += 6
  return count

N = int(input())
for n in range(1, N+1):
  print(f(n))


### FIXED CODE ###

import itertools
import collections



N = int(input())
count = [0]*N*100
m = int(N**0.5)
for x, y, z in itertools.combinations_with_replacement(range(1, m+1), 3):
  n = x**2+y**2+z**2+x*y+y*z+z*x
  k = len(set({x, y, z}))
  if k == 1:
    count[n] += 1
  elif k == 2:
    count[n] += 3
  else:
    count[n] += 6

for n in range(1, N+1):
  print(count[n])
### BUGGY CODE ###

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

A.sort(reverse=True)
ans = 0

point = []
point.append(A.pop(0))
for i in A:
    ans += point.pop(0)
    point.append(i)
    point.append(i)

print(ans)

### FIXED CODE ###

from collections import deque

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

A.sort(reverse=True)
ans = 0

point = deque()
point.append(A.pop(0))
for i in A:
    ans += point.popleft()
    point.append(i)
    point.append(i)

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

n = int(input())
t = input()
q = int(input())
s = [0]*(n*2)
for i in range(n):
  if t[i] == 'D':
    s[i+n] = 1
  elif t[i] == 'M':
    s[i+n] = 2
  elif t[i] == 'C':
    s[i+n] = 3

l = list(map(int, input().split()))
for k in l:
  d,m,dm,dmc = 0,0,0,0
  for i in range(n,n*2):
    j = i-k
    if s[j] == 1:
      d -= 1
      dm -= m
    elif s[j] == 2:
      m -= 1
    if s[i] == 1:
      d += 1
    elif s[i] == 2:
      m += 1
      dm += d
    elif s[i] == 3:
      dmc += dm
  print(dmc)

### FIXED CODE ###

def num(s,n,k):
  d,m,dm,dmc = 0,0,0,0
  for i in range(n,n*2):
    x,y = s[i],s[i-k]
    if y == 68:
      d -= 1
      dm -= m
    elif y == 77:
      m -= 1
    if x == 68:
      d += 1
    elif x == 77:
      m += 1
      dm += d
    elif x == 67:
      dmc += dm
  return dmc

def main():
  n = int(input())
  s = [0]*n + list(map(ord, list(input())))
  _ = input()
  l = list(map(int, input().split()))
  for k in l:
    print(num(s,n,k))

main()
### BUGGY CODE ###

N = int(input())
D = input()
S=list(D)
C = 0
X = 0
i=0
while i < N-X-1:
	if S[i]==S[i+1]:
		S.pop(i)
		i=0
		X+=1
	else:
		i+=1

print(len(S))


### FIXED CODE ###

N = int(input())
D = input()
S=list(D)
C = 1
X = S[0]
for i in range(N-1):

	if S[i+1]!=X:
		C+=1
		X=S[i+1]

print(C)
### BUGGY CODE ###

n,m=map(int,input().split())
lrd=[list(map(int,input().split())) for _ in range(m)]
g=[[] for _ in range(n)]
for l,r,d in lrd:
  g[l-1].append([d,r-1])
  g[r-1].append([-d,l-1])

from collections import deque
no_seen=set(range(n))
inf=float('inf')
while no_seen:
  todo=deque([[0,no_seen.pop()]])
  dst=[inf]*n
  #print(todo)
  while todo:
    d,t=todo.popleft()
    dst[t]=d
    l=g[t]
    for di,ti in l:
      if dst[ti]!=inf and dst[ti]!=d+di:
        print('No')
        exit()
      elif dst[ti]!=inf and dst[ti]==d+di:
        no_seen.discard(t)
        pass
      else:
        todo.append([d+di,ti])

print('Yes')

### FIXED CODE ###

n,m=map(int,input().split())
lrd=[list(map(int,input().split())) for _ in range(m)]
g=[[] for _ in range(n)]
for l,r,d in lrd:
  g[l-1].append([d,r-1])
  g[r-1].append([-d,l-1])

no_seen=set(range(n))
inf=float('inf')
dst=[inf]*n
while no_seen:
  todo=[[0,no_seen.pop()]]
  #print(todo)
  while todo:
    d,t=todo.pop()
    no_seen.discard(t)
    l=g[t]
    for di,ti in l:
      if dst[ti]!=inf and dst[ti]!=d+di:
        print('No')
        exit()
      elif dst[ti]!=inf and dst[ti]==d+di:
        pass
      else:
        todo.append([d+di,ti])
        dst[ti]=d+di

print('Yes')
### BUGGY CODE ###

N = int(input())
S = list(input())

ans_1 = S[1:].count("E")
ans_2 = N
for i in range(1, N-1):
    count = 0
    for j in range(N):
        if (j < i) and (S[j] == "W"):
            count += 1
        elif (j > i) and (S[j] == "E"):
            count += 1
    if ans_2 > count:
        ans_2 = count
ans_3 = S[:N-1].count("W")

print(min(ans_1, ans_2, ans_3))

### FIXED CODE ###

N = int(input())
S = list(input())

left = [0 for i in range(N)]
right = [0 for i in range(N)]
for i in range(1, N):
    if S[i-1] == "W":
        left[i] = left[i-1] + 1
    else:
        left[i] = left[i-1]
for i in range(N-1):
    if S[(N-1)-i] == "E":
        right[(N-2)-i] = right[(N-1)-i] + 1
    else:
        right[(N-2)-i] = right[(N-1)-i]

ans = left[0] + right[0]
for i in range(1, N):
    count = left[i] + right[i]
    if ans > count:
        ans = count
print(ans)
### BUGGY CODE ###

n=int(input())
seq=list(map(int,input().split()))
p=1
f=1
for i in range(n):
    p*=seq[i]
    
        
        
if(p>10**18):
        print(-1)
else:
    print(p)


### FIXED CODE ###

n=int(input())
seq=list(map(int,input().split()))
p=1
f=1
c=int(1e18)
if 0 in seq:
    print(0)
else:
    for i in range(n):
        p*=seq[i]
        if p>c:
            print(-1)
            f=0
            break
            
    if f==1:
        print(p)
### BUGGY CODE ###

num = int(input())
count = num
lists = []
for i in range(num):
    x = input()
    if x in lists:
        count -= 1
    lists.append(x)

print(count)

### FIXED CODE ###

num = int(input())
count = num
lists = []
for i in range(num):
    lists.append(input())
print(len(set(lists)))
### BUGGY CODE ###

from collections import deque
H, W = map(int, input().split())
C = [list(input()) for i in range(H)]
X = [1,0,-1,0]
Y = [0,-1,0,1]
Q = deque()
dist = [[99999]*W for i in range(H)]
for i in range(H):
  for j in range(W):
    if C[i][j] == "#":
      dist[i][j] = 0
      Q.append((i,j))
      while Q:
        y,x = Q.popleft()
        for k in range(4):
          ny = y + Y[k]
          nx = x + X[k]
          if not (0 <= nx < W):
            continue
          if not (0 <= ny < H):
            continue
          if not (C[ny][nx] == "."):
            continue
          if not (dist[ny][nx] > dist[y][x]+1):
            continue
          Q.append((ny,nx))
          dist[ny][nx] = dist[y][x] + 1
ans = 0
for i in range(H):
  ans = max(ans,max(dist[i]))
print(ans)

### FIXED CODE ###

from collections import deque
H, W = map(int, input().split())
A = [input() for i in range(H)]
X = [1,0,-1,0]
Y = [0,-1,0,1]

INF = 99999
dp = [[-1]*W for i in range(H)]
q = deque()
for y, row in enumerate(A):
  for x,c in enumerate(row):
    if c == "#":
      dp[y][x] = 0
      q.append((y,x))
while q:
  y,x = q.popleft()
  d = dp[y][x]
  for i in range(4):
    nx = x + X[i]
    ny = y + Y[i]
    if (0 <= nx < W) and (0 <= ny < H) and (dp[ny][nx] == -1):
      dp[ny][nx] = d + 1
      q.append((ny,nx))
print(max(max(row) for row in dp))