Problem:


Score : 300 points

Problem Statement

You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.

How many kinds of items did you get?

Constraints

1 \leq N \leq 2\times 10^5

S_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).

Input

Input is given from Standard Input in the following format:

N
S_1
:
S_N

Output

Print the number of kinds of items you got.

Sample Input 1

3
apple
orange
apple

Sample Output 1

2

You got two kinds of items: apple and orange.

Sample Input 2

5
grape
grape
grape
grape
grape

Sample Output 2

1

Sample Input 3

4
aaaa
a
aaa
aa

Sample Output 3

4



Sample input:
3
apple
orange
apple


Sample output:
2

Submission status: Wrong Answer

Solution code:
S = input()
from collections import Counter
def solve(S):
    n = len(S)
    cum = [0]*(n+1)
    for i in range(n):
        cum[i+1] = (cum[i]+int(S[n-1-i])*10**i)%2019
    c = Counter(cum)
    ans = 0
    for v in c.values():
        ans += v*(v-1)//2
    return ans
print(solve(S))

Submission status: Wrong Answer

Solution code:
x, lists, d = eval(input()), list(map(str, input().split())), {}
for item in lists:
   if item in d:
       d[item] += 1
   else:
       d[item] = 1
print(len(d))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
d = []
da = d.append
for _ in range(n-1):
  di = str(input())
  da(di)
di = str(input())+"\n"
da(di)
print(len(list(set(d))))

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
list=[]
for i in range(1,N+1):
  if str(input()) in list:
    pass
  else:
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
p = list((input().split()))
s = set()
for i in range(1, len(p)):
    s.add(p[i])
print(len(s))

Submission status: Wrong Answer

Solution code:
import random

n = int(input())
m = []
for i in range(n):
    m.append(input())  

ll = []
for j in range(n):
    ll.append(m[random.randrange(n)])
print(len(set(ll)))

Submission status: Wrong Answer

Solution code:
def solve():
    number=int(input())
    items=[]
    for i in range(number):
        item=input()
        items.append(item)
    count=1
    for i in range(1,number):
        if items[i]!=items[i-1]:
            count+=1
    print(count)

    return
solve()

Submission status: Wrong Answer

Solution code:
a = input()
a = int(a)
c= []
for i in range(a):
  b = input()
  c.append(b)
c = list(set(c))
#print(c)
len(c)

Submission status: Wrong Answer

Solution code:
n=int(input())
s={input() for i in range(n)}

print(s)
print(len(s))

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
print(N)
cnt = 0

for i in range(N):
    for j in range(i+4, N+1):
        if int(S[i:j]) % 2019 == 0:
            cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = []
for i in range(N):
    S.append(input())
s = sorted(S)
count = 1
for i in range(2,N):
    if s[i] != s[i-1]:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())

x=[input()[:-1] for i in range(n-1) ]
x.append(input())
y=set(x)
print(len(list(y)))

Submission status: Wrong Answer

Solution code:
N=int(input())
S_list = []
count = 0
for i in range(N):
  s = str(input())
  S_list.append(s)
  if not (s in S_list):
    count = count + 1
print(len(S_list))

Submission status: Wrong Answer

Solution code:

s = int(input())  #nは入力回数
s_list = [input() for _ in range(s)]
print(s_list)   # 出力を確認

ans = 0

s_list = set(s_list)

print(len(s_list))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = ["" for _ in range(N)]
num = 1
for i in range(N):
  S[i] = input()
List = sorted(S)
for j in range(N-1):
  if S[j] != S[j+1]:
    num += 1
print(num)

Submission status: Wrong Answer

Solution code:
N = int(input())
# N = 3

items = []

for i in range(0, N) :
    newItem = str(input())
    # newItem = str("apple")

    if newItem not in items :
        items.append(newItem)

len(items)

Submission status: Wrong Answer

Solution code:
n=input()
count=0;
lis=[]
for i in range(1,int(n)):
    s=input()
    if s in lis:
        pass
    else :
        lis.append(s)
        count+=1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = []
count = 0
for i in range(n):
    li.append(input())
li.sort()
print(li)
for i in range(n-1):
    if li[i] == li[i+1]:
        count += 1
print(n-count)

Submission status: Wrong Answer

Solution code:
n = int(input())
ls = []
count = 0
for x in range(n):
    ls.append(input())
set(ls)
print(len(ls))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = []
for i in range(N):
    temp = input()
    S.append(temp)
count = 0

while S != []:
    temp = S[0]
    count = count + 1
    for i in S:
        if i == temp:
            S.remove(i)
print(count)

Submission status: Wrong Answer

Solution code:
num=int(input())
list=[]
for i in range(num):
  a=input()
  list.append(a)
b=set(a)
print(len(b))

Submission status: Wrong Answer

Solution code:
N = int(input())
items = []
count = 0
for x in range(N):
  thing = input()
  if not x in items:
    count += 1
    items.append(thing)
print(count)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = []
for i in range(a):
    c = input()
    if c not in b == "True":
        b.append(c)
print(len(b))

Submission status: Wrong Answer

Solution code:
import bisect
N = int(input())
ss = []
for i in range(N):
  ss.append(input())
  
ss.sort()
count = N
for i in range(N):
  index= bisect.bisect(ss,ss[i])
  if index == N:
    continue
  if ss[index] == ss[i]:
    count-= 1
    
print(count)

Submission status: Wrong Answer

Solution code:
a = int(input())
aaa = list([input(i)for i in range(a)])

ans = len(set(aaa))

print(ans)

Submission status: Wrong Answer

Solution code:
numOfStr= int(input())
strlist = []
total = 0
for i in range(0,numOfStr):
    strlist.append(input())
strlist.sort()
for i in range(1,numOfStr):
    if strlist[i] != strlist[i-1]:
        total += 1
print(total)

Submission status: Wrong Answer

Solution code:
n=int(input())
list=[]
for i in range(n):
  list.append(input())
s=[]
for i in range(n-1):
  if list[i] not in s:
    s.append(list[i])
print(len(s))

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
List = [input() for i in range(n-1)]
c = collections.Counter(List)
print(len(c))

Submission status: Wrong Answer

Solution code:
N = int(input())
items = []
count = 0
for x in range(N):
  thing = input()
  if not x in items:
    count += 1
  items.append(thing)
print(count)

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces

def main():
    n = ni()
    s = [ns() for i in range(n)]
    st = tuple(s)
    print(len(st))
    return

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
a = int(input())
b = []
for i in range(a):
    c = input()
    if c not in b == True:
        b.append(c)
print(len(b))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = [ [],[],[],[],[],[],[],[],[],[] ]
ans = 0
for i in range(N):
  temps = input()
  if(temps not in S[len(temps)-1]):
    ans += 1
    S[len(temps)-1].append(temps)
print(ans)
print(S)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = list(map(str,input().split()))

T = list(set(S))
print(len(T))

Submission status: Wrong Answer

Solution code:
def gacha(sl):
    print(len(set(sl)))

n = int(input())
sl = []
for _ in range(n):
    sl.append(input())
print(sl)

gacha(sl)

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
flag = 1
l = [0] * n
ind = 0
s = [0] * n

for i in range(n):
    s[i] = input()
    for j in range(ind):
        if s[i] == l[j]:
            flag = 0
            break
    if flag :
        count += 1
        l[ind] = s[i]
        ind += 1

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = [input() for i in range(N)]

def histogram_sorted(data):
    table = []
    prev = data[0] 
    c = 1
    for i in range(1,len(data)):
        if prev == data[i]:
            c=c+1
        else:
            table.append([prev,c])
            prev = data[i]
            c = 1
    table.append([prev,c])
    return table

T = []
for i in range(N):
    T.append(S[i])
    
print(len(histogram_sorted(T)))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = []
for i in range(N):
    S.append(input())

kind = 1
S.sort()
s_old = S[0]
for i in range(1,N):
    if S[i] != s_old:
        kind += 1

print(kind)

Submission status: Wrong Answer

Solution code:
N = int(input())

S = []

for i in range(N):
    inpt = input()
    if inpt in S:
        break
    S.append(inpt)

print(len(S))

Submission status: Wrong Answer

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

print(n, s)

items = []

for i in range(n):
    new = True
    for j in range(len(items)):
        if s[i] == items[j]:
            new = False
    if new:
        items.append(s[i])
    
print(len(items))

Submission status: Wrong Answer

Solution code:
N=int(input())
dic={}
for i in range(N):
  tmp=input()
  if tmp not in dic:
    dic[tmp]=1
  else:
    dic[tmp]+=1
max=0
for i in dic:
  if dic[i]>max:
    max=dic[i]
print(max)

Submission status: Wrong Answer

Solution code:
N=int(input())
S_list = []
for i in range(N):
  s = str(input())
#  if not (s in S_list):
#    S_list.append(s)
print(len(S_list))

Submission status: Wrong Answer

Solution code:
import collections

N=int(input())
list=[input() for i in range(N)]

c= collections.Counter(list)

m=0
for i in c.values():
    m+=i

print(m)

Submission status: Wrong Answer

Solution code:
n=int(input())
s=[str(input()) for i in range (n)]
l=[0]*n
t=0
for j in range (n):
    d=1
    for k in range (t):
        if s[j]==l[k]:
            d=0
    if d==1:
        l[j]=s[j]
        t+=1
print(t)

Submission status: Wrong Answer

Solution code:
n=int(input())
s=input().split()
s=list(set(s))
print(len(s))

Submission status: Wrong Answer

Solution code:

N = int(input())
S = []
count = 1
for i in range(N):
    S.append(input())

for i in range(N-1):
    if S[i] != S[i+1]:
        count+=1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
items = []

for i in range(N):
    item = input()
    items.append(item)    
items.sort()
cnt = 0
before = ""
for index,item in enumerate(items):
    if index == 0:
        cnt += 1
        before = item
    elif before != item:
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
s=list(set(input().split()))
print(len(s))

Submission status: Wrong Answer

Solution code:
n=int(input())
list=[]
for _ in range(n):
    s=input()
    if s in list:
        pass
    else:
        list.append(s)
print(str(len(s)))

Submission status: Wrong Answer

Solution code:
import sys 
input = sys.stdin.readline
for tt in range(1):
	n = int(input())
	s = set()
	for i in range(n):
		if i==n-1:
			s.add(input().lower())
		else:
			s.add(input().lower()[:-1])
	print(len(s))

Submission status: Wrong Answer

Solution code:
N = int(input())

ls = [input()]
count = 1
for i in range(N-1):
    if input() in ls:
        pass
    else:
        count += 1
        
print(count)

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())

items = []
for _ in range(n):
  items.append(input())
  
freq = Counter(items)
print(len(items))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = []
for i in range(N):
    s = input()
    if s not in S:
        S.append(s)
print(S)
print(len(S))

Submission status: Wrong Answer

Solution code:
import collections
N=int(input())
L=[input() for i in range(N)] 
C = collections.Counter(L)
D = list(C.values())
E=sum(D)
print(E)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = []
s_append = s.append
for i in range(n):
    s_append(i)

print(len(set(s)))

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[input() for i in range(n)]
print(len(set()))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

a = defaultdict(int)
n = int(input())
for i in range(n):
    w = input()
    a[w] += 1

print(max(a.values()))

Submission status: Wrong Answer

Solution code:
import sys 
try:
	sys.stdin = open('input.txt', 'r') 
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for tt in range(1):
	n = int(input())
	s = set()
	for i in range(n):
		if i==n-1:
			s.add(input())
		else:
			s.add(input()[:-1])
	# print(s)
	print(len(s))

Submission status: Wrong Answer

Solution code:
n = int(input())
s = []
for _ in range(n):
    s.append(input())

print(s)

print(len(set(s)))

Submission status: Wrong Answer

Solution code:
x=set()
c=0
n=int(input())
for i in range(0,n):
  s=input()
  if s in x:
    pass
  else:
    x.add(s)
    c+=1

Submission status: Wrong Answer

Solution code:
nb = int(input())
l = []
i = 0
for i in range(nb):
  el = input()
  if el not in l:
    l.append(el)
    i+=1
print(i)

Submission status: Wrong Answer

Solution code:
import collections

N = int(input())

S_list = set(list(map(str,input().split())))
print(len(S_list))

Submission status: Wrong Answer

Solution code:
n = int(input())
s = set()
for i in s:
  s.add(input())
print(len(s))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

def solve():
    N = int(input())
    A = [input() for _ in range(N)]
    d = defaultdict(int)
    
    for a in A:
        d[a] += 1
    
    return len(d)

# print(solve())

# def solve()が@return voidのとき
solve()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lst = []
count = 0
for _ in range(N):
    s = input()
    if not s in lst:
        lst.append(s)
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lst = []
for _ in range(N):
    s = input()
    if not s in lst:
        lst.append(s)
print(len(lst))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = list()
for i in range(N):
    X = input()
    if X not in S:
        S.append(X)
print(len(S))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = []
used = []
ans = 0
for i in range(N):
  b = input()
  a.append(b)
  for j in a:
    if not j in used:
      ans += 1
      used.append(j)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
sl = []
ans = 0
for i in  range (n):
  s = input()
  if s not in sl:
    sl.append(s)
    ans +=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

mono = []

for i in range(N):
  S = input()
  
  if S not in mono:
    mono.append(S)

print(len(mono))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())

S=[]
for i in range(n):
    s=input()
    if s not in S:
        S.append(s)
print(len(S))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
b=[]
for j in range(N):
    a = input()
    if(a in b):
        continue
    else:
        b.append(a)

print(len(b))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = []
for _ in range(n):
    tmp = input()
    if tmp not in ans:
        ans.append(tmp)
print(len(ans))

Submission status: Time Limit Exceeded

Solution code:
d = []
e = 0
n = int(input())
for i in range(n):
    a = input()
    if a not in d:
        d.append(a)
        e += 1
print(e)

Submission status: Time Limit Exceeded

Solution code:
d = []
n = int(input())
for i in range(n):
    a = input()
    if a not in d:
        d.append(a)
print(len(d))

Submission status: Time Limit Exceeded

Solution code:
# C - gacha

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

for i in range(n):
    gacha = input()
    if gacha not in s:
        s.append(gacha)

print(len(s))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
for i in range(N):
    tmp = input()
    if tmp not in S:
        S.append(tmp)

print(len(S))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lst = []
for i in range(n):
  x = input()
  if (x not in lst):
    lst.append(x)
print(len(lst))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
s=[input() for i in range(n)]

a=[]
c=0

for i in s:
    if i not in a:
        a.append(i)
        c+=1

print(c)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=[]
b=0

for i in range(0,N):
    S=input()
    if not S in A:
        b+=1
        A.append(S)
print(b)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
l=[]
S=[input() for _ in range(N)]
x=0
for i in range(N):
    if S[i]  not in l:
        l.append(S[i])
        x+=1
print(x)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
arr = []
for _ in range(N):
  line = input()
  if line not in arr:
    arr.append(line)
print(len(arr))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
d = []
for n in range(N):
    s = input()
    if s not in d:
        d.append(s)
print(len(d))

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-

def main():
    n = int(input())
    keihin_list = []
    for i in range(n):
        s = input()
        if not s in keihin_list:
            keihin_list.append(s)
    print(len(keihin_list))

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
S.append(input())


for i in range(N-1):
    get = input()
    if S.count(get) == 0:
        S.append(get)

print(len(S))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
li=[]
cnt=0
for i in range(n):
    s=input()
    if s not in li:
        li.append(s)
        cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

ans = 0
u_l = []
for _ in range(n):
    s = input()
    if s not in u_l:
        u_l.append(s)
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = [0]*n
for i in range(n):
    s[i]= input()
s_set = set(s)
new_s = list(s_set)

def count():
    k = []
    cnt = 0
    for i in range(len(new_s)):
        if not new_s[i]in k:
            cnt += 1
            k.append(new_s[i])
    return cnt
    
r = count()
print(r)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = [0]*n
for i in range(n):
    s[i]= input()
s_set = set(s)
new_s = list(s_set)

def count():
    k = []
    cnt = 0
    for i in range(n):
        if not s[i]in k:
            cnt += 1
            k.append(s[i])
    return cnt
    
r = count()
print(r)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = [0]*n
for i in range(n):
    s[i]= input()
new_s = sorted(s)
def count():
    k = []
    cnt = 0
    for i in range(n):
        if not s[i] in k:
            cnt += 1
            k.append(s[i])
    return cnt
    
r = count()
print(r)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

def count():
    k = []
    cnt = 0
    for i in range(n):
        s = input()
        if not s in k:
            cnt += 1
            k.append(s)
    return cnt
    
r = count()
print(r)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = [0]*n

def count():
    k = []
    cnt = 0
    for i in range(n):
        s = input()
        if not s in k:
            cnt += 1
            k.append(s)
    return cnt
    
r = count()
print(r)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = [0]*n

for i in range(n):
    s[i] = input()
def count():
    k = []
    cnt = 0
    for i in range(n):
        if not s[i] in k:
            cnt += 1
            k.append(s[i])
    return cnt
    
r = count()
print(r)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = [0]*n

for i in range(n):
    s[i] = input()
def count():
    k = [0]*n
    cnt = 0
    for i in range(n):
        if not s[i] in k:
            cnt += 1
            k.append(s[i])
    return cnt
    
r = count()
print(r)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
S=[]
#A,B,C,D=map(int,input().split())
count=0
for i in range(N):
	s=input()
	if s not in S:
		S.append(s)
		count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = []
ans = 0
for i in range(n):
  s = input()
  if s in l:
    continue
  else:
    ans+=1
    l.append(s)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
box=[]
count=0
for i in range(n):
    tmp=str(input())
    if tmp not in box:
        count+=1
        box.append(tmp)
        
print(count)

Submission status: Time Limit Exceeded

Solution code:
n= int(input())
s=[]
ans=0
for i in range(n):
    x=str(input()) 
    if x not in s:
        s.append(x)
        ans +=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
scnum = int(input())
score = []
answer = 0
for i in range(scnum):
    word = input()
    if word not in score:
        score.append(word)
        answer += 1

print(answer)

Submission status: Time Limit Exceeded

Solution code:
scnum = int(input())
score = ['0']*scnum
answer = 0
for i in range(scnum):
    word = input()
    if word not in score:
        score[i] = word
        answer += 1

print(answer)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = []
for i in range(n):
    tmp = str(input())
    if not(tmp in s):
        s.append(tmp)
print(len(s))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = []
for i in range(n):
    tmp = str(input())
    if s.count(tmp) == 0:
        s.append(tmp)
print(len(s))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
l=[]
for h in range(N):
    s=input()
    if s not in l:
        l.append(s)
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
num=0
l=[]
for h in range(N):
    s=input()
    if s not in l:
        l.append(s)
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = [list(input()) for _ in range(N)]

ans = []
for i in range(N):
    flg = 0
    for j in range(len(ans)):
        if S[i] == ans[j]:
            flg = 1
            break
    if flg == 0:
        ans.append(S[i])

print(len(ans))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = [list(input()) for _ in range(N)]

ans = 0
for i in range(N):
    flg = 0
    j = 0
    while j < i:
        if S[j] == S[i]:
            flg = 1
            break
        j += 1
    if flg == 0:
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=[]
for i in range(n):
    s=input()
    flg=0
    l=len(a)
    for j in range(l):
        if a[j]==s:
            flg=1
    if flg==0:
        a.append(s)
print(len(a))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=[]
for i in range(n):
    s=input()
    flg=0
    for j in range(len(a)):
        if a[j]==s:
            flg=1
    if flg==0:
        a.append(s)
print(len(a))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = []

for i in range(n):
    a = input()
    if not a in l:
        l.append(a)
        
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
l=[]
c=0
for i in range(n):
    s=str(input())
    if(s not in l):
        l.append(s)
        c=c+1
print(c)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
for i in range(N):
    S.append(input())

ans = []
for i in range(N):
    if S[i] in ans:
        continue
    else:
        ans.append(S[i])

print(len(ans))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
for i in range(N):
    new = input()
    if new in S:
        continue
    else:
        S.append(new)

print(len(S))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = []
for i in range(N):
	a = input()
	if a not in A:
		A.append(a)
print(len(A))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
ans = 0
for i in range(N):
  A = input()
  S.append(A)
  if S.count(A) == 1:
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S =[str(input()) for i in range(N)]

G = []

for i in range(N):
    goods = S[i]
    if goods in G:
        continue
    else:
        G.append(goods)


print(len(G))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
cc = []
for i in range(N):
  a = input()
  if a in  cc:
    continue
  cc.append(a)
print(len(cc))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = ["" for i in range(n)]
ans = 0
for i in range(n):
  a = input()
  if a not in s:
    s[i] = a
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = []
ans = 0
for i in range(n):
  a = input()
  count = 0 if a in s else 1
  s.append(a)
  ans += count
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = [input() for _ in range(N)]
check = [True]*N
item = ""
cnt = 0
for i in range(N):
  if check[i] != False:
    item = S[i]
    cnt += 1
    for j in range(i+1,N):
      if S[j] == item:
        check[j] = False
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
S=[]
cnt = 0
for i in range(N):
    si= input()
    if si not in S:
        cnt += 1
        S.append(si)
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
goods = []

for _ in range(n):
  s = input()
  if s not in goods:
    goods.append(s)
    
print(len(goods))

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
list = []
count = 0
flag = 0

for i in range(num):
  cha = input()
  list.append(cha)
  for j in range(i):
    if (list[j] == list[i]):
      flag = 1
  if(flag == 0):
    count += 1
  elif(flag == 1):
    flag = 0

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S_list = []
str_cnt = 0
for n in range(N):
    tmp = input()
    if((tmp in S_list) == False):
        str_cnt += 1
        S_list.append(tmp)

print(str_cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
stock = []
for _ in range(n):
  stock.append(input())
  stock = list(set(stock))
print(len(stock))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
l = []
for i in range(N):
    x = str(input())
    if x not in l:
        l.append(x)
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

gift_list = []
for _ in range(N):
  S = input()
  if not S in gift_list:
    gift_list.append(S)

print(len(gift_list))

Submission status: Time Limit Exceeded

Solution code:
from collections import deque

n=int(input())
lst=deque([])
counter=0
for _ in range(n):
    s=input()
    if s in lst : continue
    lst.append(s)
    counter+=1

print(counter)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
lst=[]
counter=0
for _ in range(n):
    s=input()
    if s in lst : continue
    lst.append(s)
    counter+=1

print(counter)

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
data = stdin.readlines()

n = int(data[0].split()[0])

l = []
for i in range(n):
    if not data[i+1].split()[0] in l:
        l.append(data[i+1].split()[0])
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = []
cnt = 0
for i in range(n):
    s = input()
    if not s in ans:
        ans.append(s)
        cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=[]
for i in range(n):
  b=input()
  if b not in a:
    a.append(b)
print(len(a))

Submission status: Time Limit Exceeded

Solution code:
#164C
#gacha

n=int(input())
l=[]
for i in range(n):
    s=input()
    if s not in l:
        l.append(s)
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
for i in range(N):
    si = input()
    if si not in S:
        S.append(si)
print(len(S))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
for i in range(N):
    si = input()
    if si not in S:
        S = S + [si]
print(len(S))

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter
N = int(input())
S = []
for i in range(N):
    si = input()
    S = S + [si]
print(len(set(S)))

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter
N = int(input())
S = []
for i in range(N):
    si = input()
    S = S + [si]
c = Counter(S)
print(len(c))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = []
for i in range(n):
    s = input()
    if s not in l:
        l.append(s)

print(len(l))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=[]
for x in range(N):
  S=input()
  if S in A:
    pass
  else:  
    A.append(S)
print(len(A))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
arr = []
for _ in range(n):
    s = input()
    if not(s in arr):
        arr.append(s)
print(len(arr))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
lst=[]
for i in range(n):
 lst.extend(input().split())
 new_list=set(lst)
print(len(new_list))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
lst=[]
for i in range(n):
 lst.extend(input().split())
list_uniq=[]
ans=0
for j in lst:
 if list_uniq.count(j)==0:
    list_uniq.append(j)
    ans+=1
 else:
    pass
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=[]
for i in range(n):
  word=input()
  if word not in a:
    a.append(word)
print(len(a))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

ans = 0
list = []

for _ in range(n):
    a = input()
    if a not in list:
        list.append(a)
        ans +=1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = [input() for _ in range(n)]
ans = []

for i in s:
  if i not in ans:
    ans.append(i)

print(len(ans))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
goods = []
count = 0
for i in range(N):
  good = str(input())
  if good not in goods:
    goods.append(good)
    count +=1
    
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
goods = []
for i in range(N):
  good = str(input())
  if good not in goods:
    goods.append(good)
    
print(len(goods))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
S=[]
count=0
for i in range(N):
    A=input()
    if A not in S:
        S.append(A)
        count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
S=[]
for i in range(N):
    A=input()
    if A not in S:
        S.append(A)
print(len(S))

Submission status: Time Limit Exceeded

Solution code:

n = int(input())

strs = [input() for _ in range(n)]
buff = ['A']
# print(strs, buff)
for word in strs:
    flag = 0
    
    for bum in buff:
        # print(word, bum)
        if word == bum:
            flag = 1
        
    if flag != 1:
        buff.append(word)
    # print(strs, buff)

print(len(buff)-1)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = [input() for i in range(N)]

keihin  = []
ans = 0
for i in S:
  if i not in keihin:
    keihin.append(i)
    ans += 1
print(ans)