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: Time Limit Exceeded

Solution code:
N=int(input())
a=[str(input())]
s=1
#sは現時点で何個景品が手に入ったかを示す
for i in range (0,N-1):
    #残りn-1回の当選結果について確認
    temp=str(input())#tempはとりあえず入力を受け取る
    t=0
    for j in range(0,s):
      #今までのものに重複がないかチェック
      if temp == a[j]:
        t=t+1
    if t == 0:
        a.append(temp)
        s=s+1
print(s)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
gacha_item = set()
for i in range(N):
    s = input()
    gacha_item = gacha_item|{s}
    
print(len(gacha_item))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
num = int(input()) - 1
j = 0
target = [input()]
hit = 1
x = 0
while j <= num - 1:
    check = input()
    if check not in target:
        target.append(check)
        hit += 1
    j += 1
print(hit)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
list = []
cnt = 0

for i in range(N):
    S = input()
    if S in list :
        continue
    else :
        list.append(S)
        cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

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

if N==0:
  print(0)
  
S_div.append(S[0])
count+=1

for i in S:
    if i in S_div:
      continue
    S_div.append(i)
    count+=1
else:
  print(count)

Submission status: Time Limit Exceeded

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

lists = []
count = 0
for i in range(N):
    if S[i] in lists:
        pass
    else:
        lists.append(S[i])
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N =int(input())
P = [input() for i in range(N)]
#print(P)
S = [[] for i in range(N)]
S[0] = int(1)
M = [[] for i in range(N)]
for i in range(N) :
    for j in range(i+1,N) :
        #print (P[i]) 
        #print (P[j])
        if M[j] != 1 :
            if P[i] == P[j] :
                S[j] = 0 
                M[j] = 1
            else :
                S[j] = 1

#print (S)
ans = int(sum(S))

print (ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
S = []
while N > 0:
  data=input()
  N-=1
  if data not in S:
    S.append(data)
print(len(S))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
list = [input()]
count=1
for i in range(N-1):
    s = input()
    ind = 0
    for j in range(len(list)):
        if s == list[j]:
            break
        if s != list[j]:
            ind +=1
    if ind == len(list):
        list.append(s)
        count+=1
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:


def cal():
    number = int(input())
    strList1 = []
    for i in range(number):
        strList1.append(list(map(str, input().rstrip().split())))
    strList2 = [strList1[0]]
    for each in strList1:
        flag = 1
        for item in strList2:
            if item == each:
                flag = 0
                break
        if flag == 1:
            strList2.append(each)
    print(len(strList2))


cal()

Submission status: Time Limit Exceeded

Solution code:
import sys
import re

def check(list, word):
  isMatch = False
  for i in reversed(range(len(list))):
    #match =re.search(word+'*', list[i])
    if word == list[i]:
      isMatch = True    
      list.pop(i)

  return isMatch, list

def calc(list):
  count = 0
  while len(list) > 0:
    ret = check(list, min(list))
    if ret[0] == True:
      count += 1
    list = ret[1]

  return count

N = int(input())
A = sys.stdin.readlines()
#改行コード削除
A = [b.strip() for b in A]

#print(N)
#print(A)
#print(min(A))

#最小文字数の単語から調査
#正規表現として、同じ重複があったらカウントし、リストからその要素を削除
#何種類あるかをカウント
print(calc(A))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = []
# for n_str in range (0, n):
#     s[n_str] = input()
s = [input() for n_str in range(n)]

diction = []
# print(diction[0])
flag = 0

diction.append(s[0])

for cnt in range(n):
    for comp in range(cnt+1, n):
        if s[cnt] != s[comp]:
            dict_len = len(diction)
            for dict_serch in range(dict_len):
                if s[comp] == diction[dict_serch]:
                    flag = 1
            if flag == 0:
                diction.append(s[comp])
            else:
                flag = 0

print(len(diction))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
S=['']*N
count=0

for i in range(N):
    tmp=input()
    if not(tmp in S):
        count+=1
        S[i]=tmp

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = N
S = [input() for _ in range(N)]
for i in range(N):
    for k in range(i):
        if S[k] == S[i]:
            A -= 1
            break
print(A)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
#かぶってない文字列を格納するリスト
l = []

for i in range(n):
    tmp = input()
    if not(tmp in l):
        l.append(tmp)

print(len(l))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ans = 0
l = [] * N


for k in range(N):
  t = input()
  if t not in l:
    ans += 1
    l.append(t)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math

N = int(input())
A = []

for i in range(N):
    flag = True
    S = input()
    for j in range(len(A)):
        if S == A[j]:
            flag = False
            break
    if flag == True:
        A.append(S)

print(len(A))

Submission status: Time Limit Exceeded

Solution code:


def cal():
    number = int(input())
    strList1 = []
    for i in range(number):
        strList1.append(list(map(str, input().rstrip().split())))
    strList2 = [strList1[0]]
    for each in strList1:
        flag = 1
        for item in strList2:
            if item == each:
                flag = 0
        if flag == 1:
            strList2.append(each)
    print(len(strList2))


cal()

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline

N = int(input())
list = []
count = []

for i in range(N):
    l_append = list.append
    l_append(input())

for x in list:
    if x in count:None
    else:count.append(x)

print(len(count))

Submission status: Time Limit Exceeded

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

for i in l:
  if not i in new_l:
    new_l.append(i)

print(len(new_l))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
cnt = 0
list = []

while cnt < N :
    S = input()
    if S in list :
        cnt += 1
        continue
    else :
        list.append(S)
        cnt += 1

print(len(list))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = [input().split() for i in range(N)]
S_list = []
for i in range(N):
  if S[i] not in S_list:
    S_list.append(S[i])
  else:
    pass
answer = len(S_list)
print(answer)

Submission status: Time Limit Exceeded

Solution code:
import sys
sys.setrecursionlimit(4100000)

lis =[]
abc =[]
count = 0

N = int(input())
for _ in range(N):
    lis.append(input())

for i in lis:
    if any(i == j for j in abc):
        pass
    else:
        abc.append(i)
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

for i in S:
  if count==0:
    S_div.append(i)
    count+=1
  else :
    if i in S_div:
      continue
    S_div.append(i)
    count+=1
else:
  print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
l = []
k = 0
for i in range(N):
    S = input()
    l.append(S)
for i in range(N):
    while True:
        try:
            a = l.index(l[i])
        except ValueError:
            k += 1
            break
print(k)

Submission status: Time Limit Exceeded

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

for i in range(N):
  sakujo = S[0]
  S = [s for s in S if s != sakujo]
  if not S:
    print(i+1)
    break

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

SL = []

for ss in range(N):
    S = input()

    F = True
    for M in SL:
        if M == S:
            F = False
            break

    if F :
        SL.append(S)


print(len(SL))

Submission status: Time Limit Exceeded

Solution code:
lis =[]
abc =[]
count = 0

N = int(input())
for _ in range(N):
    lis.append(input())

for i in lis:
    if any(i == j for j in abc):
        pass
    else:
        abc.append(i)
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
if __name__ == '__main__':
    n = int(input())
    lis = []
    for i in range(n):
        lis.append(input())
        lis=list(set(lis))
    print(len(lis))

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())
a = [input() for i in range(n)] 
ans =1
s = [a[0]]

for i in a[1:]:
    if not i in s:
        ans += 1
        s.append(i)
    else:
        continue
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
num = int(input()) - 1
j = 0
target = [input()]
hit = 1
x = 0
while j <= num - 1:
    check = input()
    if check in target:
        x +=1
    else:
        target.append(check)
        hit += 1
    j += 1
print(hit)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = [input() for i in range(n)]
cnt = 0
while True:
    s = [l for l in s if l != s[0]]
    cnt += 1
    if len(s) == 0:
        break

print(cnt)

Submission status: Time Limit Exceeded

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

S = sorted(S)
count = 0
first = 0
removecount = 0

for i in range(N):
    j = 0
    while first + count + 1 < len(S) :
        if S[first]==S[first+1+j]:
            S[first+1+j] = "nullsad"
            count+=1
            j += 1
        else:
            first += count + 1
            removecount += count
            count = 0
            break

for i in range(removecount + count):
    S.remove("nullsad")

print(len(S))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N =int(input())
P = [input() for i in range(N)]
#print(P)
S = [[] for i in range(N)]
S[0] = int(1)
for i in range(N) :
    for j in range(i+1,N) :
        #print (P[i]) 
        #print (P[j])
        if P[i] == P[j] :
            S[j] = 0 
        elif S[j] != 0 :
            S[j] = 1

#print (S)
ans = int(sum(S))

print (ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
list = []
count = []

for i in range(N):
    l_append = list.append
    l_append(input())

for x in list:
    if x in count:None
    else:count.append(x)

print(len(count))

Submission status: Time Limit Exceeded

Solution code:
n = input()

n = int(n)
s = [0]*n
sm = []

for i in range(0,n):
  s[i] = input()

for i in range(0,n):
  c = 1
  sm.insert(0,s[i])
  for j in range(1,len(sm)):
    if(sm.count(s[i]) > 1):
      del sm[0]

print(len(sm))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
l=[]
l.append(input())
for i in range(1,N):
  s=input()
  for j in range(len(l)):
    if s==l[j]:
      break
    if j == len(l)-1:
      l.append(s)
  
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
count = 0
flag = 1
l = [[[0] * n for i in range(10)] for j in range(26)]
ind = 0
s = [0] * n

alpha2num = lambda c: ord(c) - ord('a') + 1


for i in range(n):
    s[i] = input()
    leng = len(s[i]) - 1
    
    s_list = list(s[i])
    index = s_list[0]
    ind = alpha2num(index) - 1
    
    flag = 1
    for j in range(len(l[ind][leng])):
        if s[i] == l[ind][leng][j]:
            flag = 0
            break
    if flag:
        l[ind][leng].append(s[i])
        count += 1

print(count)

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),end="")

Submission status: Time Limit Exceeded

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


print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
s= []
for _ in range(n):
    s.append(input())
count=1
for i in range(1,n):
    for j in range(i):
        if s[i]==s[j]:
            break
    else:
      count=count+1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = N
S = []
for i in range(N):
    S += [input()]
    for k in range(i):
        if S[k] == S[i]:
            A -= 1
            break
print(A)

Submission status: Time Limit Exceeded

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

list = [S[0]]
for i in range(n):
    for j in range(len(list)):
        if list[j] == S[i]:
            break
        if j == len(list)-1:
            list.append(S[i]);

print(len(list))

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

N = int(input())
keihin=[]
count = 0

for i in range(N):
    p_c = 0
    present = input()
    if len(keihin) == 0:
        keihin = np.append(keihin, present)
        count = count + 1
    else:
        for j in range(len(keihin)):
            if keihin[j] == present:
                break
            if j == len(keihin)-1:
                keihin = np.append(keihin, present)
                count = count + 1
print(count)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ans = 0
l = [] * N
P = [input() for i in range(N)]

for k in range(N):
  if P[k] not in l:
    ans += 1
    l.append(P[k])

print(ans)

Submission status: Time Limit Exceeded

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

for i in range(N):
    Si = input()
    if Si in ans:
        continue
    else:
        ans.append(Si)

print(len(ans))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a=[]
for i in range(N):
    a.append(input())
a=sorted(a)
c=0
while c!=len(a)-1:
    if a[c]==a[c+1]:
        a.pop(c+1)
    else:
        c+=1
print(len(a))

Submission status: Time Limit Exceeded

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

for i in range(N):
  S = [s for s in S if s != S[0]]
  if not S:
    print(i+1)
    break

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ss = []
mylist =[]
for i in range(n):
    temp = input()
    ss.append(temp)
    
cnt = 0
for s in ss:
    if s in mylist:
        next
    else:
        mylist.append(s)
        cnt += 1
        
print(cnt)

Submission status: Time Limit Exceeded

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


i = n#
j = 0#何個かぶったか

sum2 = 0


for k in range(i):
    for l in range(i):
        if s[k] == s[l]:
            j += 1
            
    if j == 1:
      j = 0
      sum2 += 1
    else:
        temp = s[k]
        for m in range(j):
            s.remove(temp)
        s = [temp]  + s

        i -= (j-1)
        sum2 += j
        j = 0

    if sum2 == n:
      break
          

sum1 = len(s)
print(sum1)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
list = [input()]
count=1
for i in range(N-1):
    s = input()
    if s in list:
        pass
    if s not in list:
        list.append(s)
        count+=1

print(count)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
s=[]
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())

L = []

for i in range(N):
  W = input()
  if W not in L:
    L.append(W)
    
print(len(L))

Submission status: Time Limit Exceeded

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

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

print(len(a))

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8

def main():
    from sys import stdin
    
    num = int(stdin.readline())
    
    reward = []
    
    for i in range(num):
        kari = stdin.readline().strip("\n")
        aru = 0
        for j in range(len(reward)):
            if reward[j] == kari:
                aru = 1
                break
        if aru == 0:
            reward.append(kari)

    print(len(reward))

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

li = []

for i in range(n):
    x = input()
    if x not in li:
        li.append(x)

print(len(li))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

SL = [[],[],[],[],[],[],[],[],[],[],[]]

for ss in range(N):
    S = input()

    if not S in SL[len(S)] :
        SL[len(S)].append(S)

SUM = 0

for B in SL:
    SUM += len(B)

print(SUM)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
ans=N
S=[input() for i in range(N)]
for i in range(N):
    a=1
    for j in range(N):
        if i>j:
            if S[i]==S[j]:
                a=0
            else:
                pass
    if a==0:
        ans=ans-1
    else:
        pass
print(ans)

Submission status: Time Limit Exceeded

Solution code:
#coding: UTF-8

if __name__ == "__main__":
    N = int(input())

    fruits = []

    for i in range(N):
        fruits.append(input())

    count = 0
    fruitsCount = []
    fruitsCount.append(fruits[0])


    for f in fruits:
        if f in fruitsCount:
            count = count + 1
        else:
            fruitsCount.append(f)

    print(len(fruitsCount))

Submission status: Time Limit Exceeded

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

for i in range(N-1):
  s = str(input())
  for j in range(len(list)):
    if list[j]==s: break
    elif j==len(list)-1 : list.append(s)

print(len(list))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
s= []
for _ in range(n):
    s.append(input())
S=[]
S.append(s[0])
for i in range(1,n):
    for j in range(len(S)):
        if s[i]==S[j]:
            break
    else:
      S.append(s[i])
print(len(S))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def hahaha():
    n=int(input())
    list=[]
    count=0
    for i in range(0,n):
        x=str(input())
        if not(x in list):
            count+=1
            list.append(x)

    print(count)
if __name__ == '__main__':
    hahaha()

Submission status: Time Limit Exceeded

Solution code:
import math

N = int(input())
A = N
S = []
for i in range(N):
    S += [input()]
    for k in range(i):
        if S[k] == S[i]:
            A -= 1
            break
print(A)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A=  []
sum1=0
conut=0
for i in range(0,n):
    a = input()
    A.append(a)

while len(A) != 0:
    count=A.count(A[0])
    len_A = len(A)
    
    for i in range(0,count):
        A.remove(A[0])
    
    if len(A)!= len_A:
        sum1+=1
print(sum1)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
li=[]
l=[]
for i in range(n):
  s=input()
  li.append(s)
  if li[i] not in l:
    l.append(li[i])
print(len(l),end="")

Submission status: Time Limit Exceeded

Solution code:
if __name__ == '__main__':
    n = int(input())
    lis = ''
    for i in range(n):
        lis = lis + input() + '\t'
    print(len(list(set(lis.rstrip('\t').split('\t')))))

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
from sys import stdin

num = int(stdin.readline())

reward = []

for i in range(num):
    kari = stdin.readline().strip("\n")
    aru = 0
    for j in range(len(reward)):
        if reward[j] == kari:
            aru = 1
            break
    if aru == 0:
        reward.append(kari)

print(len(reward))

Submission status: Time Limit Exceeded

Solution code:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


x = ni()
s= [[] for i in range(26)]
sum=0
for i in range(x):
    si=ns()
    sn=ord(si[0:1])-97
    if si not in s[sn]:
       s[sn].append(si)
for s1 in s:
    sum+=len(s1)
print(sum)

Submission status: Time Limit Exceeded

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

for i in range(N):
  W = input()
  if W not in list:
    list.append(W)
    count += 1
    
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ss = []
mylist =[]
for i in range(n):
    temp = input()
    if temp in ss:
        next
    else:
        ss.append(temp)
        
print(len(ss))

Submission status: Time Limit Exceeded

Solution code:
import math

N = int(input())
A = N
S = []
for i in range(N):
    S += [input()]
for j in range (1, N):
    for k in range(j):
        if S[k] == S[j]:
            A -= 1
            break
print(A)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a=[0]*(N+2)
c=0
for i in range (N):
    S=input()
    d=0
    for j in range (N):
        #print(j,S,a[j])
        if a[j]!=S:
            d=0
        else:
            a[j]=S
            d=1
            break
    if d==0:
        a[c]=S
        c+=1
print(c)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
keihinn_list = []
for i in range(n):
    keihinn_list.append(input())
keihinn_list.sort()
count = 0

while True:
    if len(keihinn_list) == 0:
        break
    else:
        keihinn = keihinn_list[0]
        a = keihinn_list.count(keihinn)
        keihinn_list = keihinn_list[a:]
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
S = []
A=  []
sum1=0
conut=0
for i in range(0,n):
    a = input()
    S.append(a)
    A.append(S[i])

while len(A) != 0:
    count=A.count(A[0])
    len_A = len(A)
    
    for i in range(0,count):
        A.remove(A[0])
    
    if len(A)!= len_A:
        sum1+=1

    
print(sum1)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
li=[]
l=[]
for i in range(n):
  s=input()
  li.append(s)
for i in range(n):
  if li[i] not in l:
    l.append(li[i])
print(len(l),end="")

Submission status: Time Limit Exceeded

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

for i in range(N):
  input_line = input()
  if input_line in gacha_list:
    None
  else:
    gacha_list.append(input_line)
  
print(len(gacha_list))

Submission status: Time Limit Exceeded

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


tmp = []
for i in s:
  if (i in tmp):
    continue
  else:
  	tmp.append(i)
    
print(len(tmp))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

l = []

ans = 1

s = input()
l.append(s)

for i in range(N-1):
    s = input()
    t = s in l
    if t == False:
        ans += 1
        l.append(s)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
list=[]
sum=0
for _ in range(n):
    c=input()
    result=list.count(c)
    if result==0:
        list.append(c)
        sum=sum+1
print(sum)

Submission status: Time Limit Exceeded

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

for i in range(N):
  W = input()
  if W not in list:
    list.append(W)
    count += 1
    
print(count)

Submission status: Time Limit Exceeded

Solution code:
def moji_list(*args):
    moji = []
    for i in range(len(args)):
        moji.extend([chr(j) for j in range(args[i][0], args[i][1])])
    return moji

n = int(input())
l = []
ans = 0
letter = moji_list((97, 123))


for i in range(26):
    l.append([])


for i in range(n):
    string = input()
    first = string[0]
    spot = ord(first) - 97
    if string not in l[spot]:
        l[spot].append(string)
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
n = 0
eq = True


for i in range(N):
    s = input()
    n += 1
    length = len(S)
    for i in range(length):
        if s == S[i]:
            eq = False
    if not eq:
        n -= 1
    S.append(s)

print(n)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
list=[]
i=0
sum=0
for i in range(n):
    c=input()
    result=list.count(c)
    if result==0:
        list.append(c)
        sum=sum+1
print(sum)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
goods=[]
for i in range(N):
  s=input()
  tmp=0
  for j in range(len(goods)):
    if goods[j]==s:
      tmp=1
      break
  if tmp==0:
    goods.append(s)
print(len(goods))

Submission status: Time Limit Exceeded

Solution code:
def hahaha():
    n=int(input())
    list=[]
    count=0
    flag=0
    for i in range(0,n):
        list.append(str(input()))
        flag=0
        for j in range(0,i):
            if list[i]==list[j]:
                flag=1
        if flag==0:
            count=count+1
    print(count)
if __name__ == '__main__':
    hahaha()

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
lists = []
count = 0
for i in range(num):
    x = input()
    if x not in lists:
        lists.append(x)
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
s=[]
for i in range(N):
  flag = 0
  a = input()
  for i in range(len(s)):
    if(s[i] == a):
      flag += 1
      break
  if(flag == 0):
    s.append(a)
print(len(s))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
count = 0
flag = 1
l = [[0] * n for i in range(26)]
ind = 0
s = [0] * n

alpha2num = lambda c: ord(c) - ord('a') + 1


for i in range(n):
    s[i] = input()
    leng = len(s[i])
    s_list = list(s[i])
    index = s_list[0]
    ind = alpha2num(index) - 1
    
    flag = 1
    for j in range(len(l[ind])):
        if s[i] == l[ind][j]:
            flag = 0
            break
    if flag:
        l[ind].append(s[i])
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
s = [0]*n
dic = []
count = 1
for i in range(n):
    s[i] = input()

sorted(s)
for i in range(n):
    sw = 0
    if i == 0:
        dic.append(s[0])
    else:
        for name in dic:
            if str(name) == str(s[i]):
                sw = 1
                break
        if sw == 0:
            dic.append(s[i])
            count += 1
print(count)

Submission status: Time Limit Exceeded

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

chofuku = []
count = 0
for shohin in s:
	if shohin not in chofuku:
		count += 1
		chofuku.append(shohin)
print(count)