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: Accepted

Solution code:
n = int(input())

print(len(set(input() for _ in range(n))))

Submission status: Accepted

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

S = set(S)
print(len(S))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    r = set()
    for _ in range(N):
        r.add(input())
    return len(r)

print(main())

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def lcm(x, y) : return (x * y) // math.gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")
def YesNo(B) : print("Yes" if B else "No")
def YESNO(B) : print("YES" if B else "NO")

N = I()

s = set()
for i in range(N):
    s.add(input())

print(len(s))

Submission status: Accepted

Solution code:
N = int(input())

ans = set()
for _ in range(N):
    ans.add(input())

print(len(ans))

Submission status: Accepted

Solution code:
n = int(input())
results = {input() for _ in range(n)}
print(len(results))

Submission status: Accepted

Solution code:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math

import itertools
import heapq
#import bisect

import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)


def main():
    n=int(input())
    s=set()
    for i in range(n):
        s.add(input())
    print(len(s))



if __name__ == "__main__":

    main()

Submission status: Accepted

Solution code:
import sys
range = xrange
input = raw_input

print len(set(sys.stdin.read().split())) - 1

Submission status: Accepted

Solution code:
num = int(input())
l1 = [input() for i in range(num)]
l2 = set(l1)
print(len(l2))

Submission status: Accepted

Solution code:
import sys
from math import log2,floor,ceil,sqrt
# import bisect
# from collections import deque
sys.setrecursionlimit(7*10**4)

Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
 
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 18
MOD =  998244353

# for _ in range(int(ri())):
n = int(ri())
s = set()
for i in range(n):
    temp = ri()
    s.add(temp)
print(len(s))

Submission status: Accepted

Solution code:
n = int(input())

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

l = set(s)
print(len(l))

Submission status: Accepted

Solution code:
# python 3.8.2用
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
from math import gcd
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def lcm(a,b):return (a*b) // gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def lprint(l): print(*l, sep='\n')

N = iin()
s = set()
for _ in range(N):
    s.add(input())
print(len(s))

Submission status: Accepted

Solution code:
import sys


n, *s = sys.stdin.read().split()
def main():
    print(len(set(s)))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
appeared = []
for _ in range(N):
    appeared.append(input().strip())
print(len(set(appeared)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())
S = [input() for _ in range(N)]

S = set(S)
print(len(S))

Submission status: Accepted

Solution code:
N = int(input())

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

print(len(set(S)))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
s = set()
for _ in range(N):
  s.add(input()[: -1])
print(len(s))

Submission status: Accepted

Solution code:
import sys,os
from collections import defaultdict, deque
from math import ceil, floor
if sys.version_info[1] >= 5:
    from math import gcd
else:
    from fractions import gcd
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    MOD = 10**9+7

    b = defaultdict(int)
    N = II()
    for i in range(N):
        b[input()] += 1
    print(len(list(b.keys())))
    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

n = int(input())
S = list(map(lambda s: s.strip(), sys.stdin.readlines()))

x = {}

for s in S:
    x[s] = True

print(len(x.keys()))

Submission status: Accepted

Solution code:
from collections import defaultdict
N = int(input())
d = defaultdict(int)

for _ in range(N):
    s = input()
    d[s] += 1
    
print(len(d))

Submission status: Accepted

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

print(len(list(set(S))))

Submission status: Accepted

Solution code:
n = int(input())
d = {}
for i in range(n):
    s = input()
    try:d[s]+=1
    except:d[s]=1
print(len(d))

Submission status: Accepted

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

print(len(set(s)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
def main():
    N = int( input())
    S = Counter( [ input() for _ in range(N)])
    print( len(S))
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    S = [input() for _ in range(n)]

    print(len(set(S)))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(len(set(li)))

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    str_list = [input() for _ in range(n)]



    print(len(set(str_list)))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(len(set(si)))

Submission status: Accepted

Solution code:
N=int(input())
x=dict()
for i in range(N):
    s=input()
    x[s]=1
ans=0
for idx in x:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
data = []
for i in range(N):
    S = input()
    data.append(S)
print(len(set(data)))

Submission status: Accepted

Solution code:
mod=10**9+7
# N=int(input())
# S=input()
# A,B,C,D=map(int,input().split())
from collections import defaultdict
Hash=defaultdict(lambda:0)
N=int(input())
for i in range(N):
    Hash[input()]+=1
print(len(Hash.keys()))
# print(N)

Submission status: Accepted

Solution code:
# coding: utf-8
N=int(input())
L=[]
for i in range(N):
    L.append(input())

print(len(set(L)))

Submission status: Accepted

Solution code:
n=int(input())
s=["0"]*n
for i in range(n):
    s[i] = input()
print(len(set(s)))

Submission status: Accepted

Solution code:
#MLE注意！ not は使わず !=
#0や1のケースに注意

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    s = []
    for _ in range(n):
        a = input().rstrip()
        s.append(a)
    print(len(set(s)))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

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

Submission status: Accepted

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# 2数の最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

# リストの要素の最小公倍数
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

# リストの要素の最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

# 素数判定
def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True


# limit以下の素数を列挙
def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

# 同じものを含む順列
def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        # set（集合）型で重複を削除、ソート
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret


# ここから書き始める
n = int(input())
x = set()
for i in range(n):
    x.add(input())
print(len(x))

Submission status: Accepted

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

A=list(set(A))
print(len(A))

Submission status: Accepted

Solution code:
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
import math
from copy import deepcopy
import queue
#import sympy as syp(素因数分解とか)
Mod = 1000000007
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

def main():  #startline-------------------------------------------
    n = int(input())
    s = [input() for i in range(n)]
    print(len(set(s)))
if __name__ == "__main__":
    main() #endline===============================================

Submission status: Accepted

Solution code:
mod = 10**9+7
import sys
from collections import Counter, defaultdict, deque
from itertools import product, permutations, combinations
from itertools import accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from math import ceil,floor
from copy import deepcopy
from heapq import heappop,heappush,heapify
import heapq


# l = ['a', 'a', 'a', 'a', 'b', 'c', 'c']
# c = collections.Counter(l)

sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

# リストの要素を改行を挟んで表示する
p2D = lambda x: print(*x, sep="\n")
# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())

def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())

# 入力全てを整数に変換したものの配列を受け取る
# def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI(): return list(map(lambda x:int(x), sys.stdin.readline().split()))
def HI(): return list(map(lambda x:int(x)*(-1), sys.stdin.readline().split()))


n = II()
l = []
for _ in range(n):
	l.append(input())

c = Counter(l)
print(len(c))

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

n=int(input())
a=[0 for _ in range(n)]
for i in range(n):
    a[i]=input()
print(len(set(a)))

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    s = [0 for i in range(n)]
    g = {}
    ans = 0
    for i in range(n):
        s[i] = input()
        if g.get(s[i]) == None:
            g[s[i]] = 1
            ans += 1

    print(ans)
    
main()

Submission status: Accepted

Solution code:
n = int(input())

s = []

for i in range(n):
	tmp = input()
	s.append(tmp)

print(len(list(set(s))))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, S: "List[str]"):
    keihin = set()
    for s in S:
        keihin.add(s)
    print(len(keihin))
    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
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    solve(N, S)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
S = set()
cnt = 0
for i in range(n):
  S.add(input())

print(len(S))

Submission status: Accepted

Solution code:
N = int(input())
S = [input() for i in range(N)]
from collections import Counter
Sc = Counter(S).most_common()
print(len(Sc))

Submission status: Accepted

Solution code:
N = int(input())
s = set()
for _ in range(N):
    s.add(input())
print(len(s))

Submission status: Accepted

Solution code:
N = int(input())
Sn = [input() for _ in range(N)]
print(len(set(Sn)))

Submission status: Accepted

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

print(len(set(S)))

Submission status: Accepted

Solution code:
N = int(input())
A = set([input() for _ in range(N)])
print(len(A))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

def l_in():
    return list(map(int, input().split()))

def print_l(l):
    print(' '.join(map(str, l)))

class Interval():
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i-1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)

        res = self.sum_li[min(self.n-1, b-1)]
        if a > 0:
            res -= self.sum_li[a-1]
        return res

n = n_in()
s = set()
[s.add(s_in()) for _ in range(n)]
print(len(s))

Submission status: Accepted

Solution code:
import sys
import math  # noqa
import bisect  # noqa
import queue  # noqa


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


def main():
    N = int(input())

    prize = set()
    for _ in range(N):
        S = input()
        prize.add(S)

    print(len(prize))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
n=int(input())
d=set()
for _ in range(n):
    s=input().rstrip()
    d.add(s)
print(len(d))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
## io
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))
## dp
INIT_VAL = 0
MD2 = lambda d1,d2: [[INIT_VAL]*d2 for _ in range(d1)]
MD3 = lambda d1,d2,d3: [MD2(d2,d3) for _ in range(d1)]
## math
DIVC = lambda x,y: -(-x//y)
DIVF = lambda x,y: x//y
from collections import Counter

def main():
    n = II()
    ss = [IS() for _ in range(n)]
    c = Counter(ss)
    print(len(c))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import collections
N = int(input())

l = []
for x in range(N):
  s = input()
  l.append(s)

c = collections.Counter(l)

print(len(c))

Submission status: Accepted

Solution code:
N = int(input())
s = set(input() for _ in range(N))
print(len(s))

Submission status: Accepted

Solution code:
def main():
    items = set()
    n = int(input())
    for i in range(n):
        s = input()
        items.add(s)

    print(len(items))
    

main()

Submission status: Accepted

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
N = int(input())
a = []
for _ in range(N):
    a.append(input())
print(len(set(a)))

Submission status: Accepted

Solution code:
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *					# ll = deepcopy(l)
from heapq import *					# heappush(hp,x)
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from bisect import *				# bisect_left(arr,x,start,end)  => start and end parameters are temporary
from sys import stdin				# bisect_left return leftmost position where x should be inserted to keep sorted
from sys import maxsize				# minn = -maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *				# pre = [0] + list(accumulate(l))
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(l):
	return (len(dict(Counter(l))))
	

T = int(input())
L = []
for _ in range(T):
	l = input()
	L.append(l)
print(solve(L))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    ans = set()
    for _ in range(N):
        S = input()
        ans.add(S)

    print(len(ans))
    


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline

N, *S = map(str, read().split())
print(len(set(S)))

Submission status: Accepted

Solution code:
N = int(input())
S = [input() for _ in range(N)]
ans = set(S)
print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC164c


def main():
    import sys
    sys.setrecursionlimit(10**6)
    # 再帰関数を使わない限りPypyで出すこと

    def dump(*args):
        sys.stderr.write(str(args))

    n = int(input())
    s = [input() for _ in range(n)]
    print(len(set(s)))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

N=int(input())
S=[0]*N
for i in range(N):
  S[i]=input()
  
d=dict(Counter(S))
print(len(d))

Submission status: Accepted

Solution code:
n = int(input())
lis = set()
count = 0
for _ in range(n):
    lis.add(input())

print(len(lis))

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N = int(rl())
    kind = set()
    for _ in range(N):
        s = input()
        kind.add(s)
    print(len(kind))


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n = int(input())

result = {}

for i in range(n):
    result[input().rstrip()] = 1

print(len(result.keys()))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
N = int(input())
S = [input() for i in range(N)]
C = collections.Counter(S)
print(len(C))

Submission status: Accepted

Solution code:
N=int(input())
dic={}
for i in range(0,N):
    s=input()
    if s not in dic.keys():
        dic[s]=0
        dic[s]=1

ans=0
for i in dic.keys():
    ans+=dic[i]
print(ans)

Submission status: Accepted

Solution code:
def main():
    n=int(input())
    st=set()
    for i in range(n):
        st.add(input())
    print(len(st))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
dat = dict()
for _ in range(n):
    s = input()
    dat[s] = True
k = dat.keys()
print(len(k))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
s = [input() for _ in range(n)]
cnt = Counter(s)
print(len(cnt))

Submission status: Accepted

Solution code:
n = int(input())

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

print(len(set(A)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    from collections import defaultdict
    counter = defaultdict(int)
    N = int(input())
    for _ in range(N):
        counter[input().rstrip()] += 1
    print(len(counter))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import defaultdict
N = int(input())
d = defaultdict(int)
for i in range(N):
    S = input()
    d[S] += 1
print(len(d))

Submission status: Accepted

Solution code:
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n = ii()
s = set()
for i in range(n):
    ss = input()
    s.add(ss)
print(len(s))

Submission status: Accepted

Solution code:
n = int(input())
keihin = {}
for i in range(n):
    s = input()
    try:
        keihin[s] += 1
    except:
        keihin[s] = 1
print(len(keihin.keys()))

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
ls = []
for _ in range(N):
    ls.append(input())
cnt = Counter(ls)
print(len(cnt.keys()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

from collections import defaultdict
dic = defaultdict(int)

for _ in range(n):
    sl = input()
    dic[sl] += 1

print(len(dic.values()))

Submission status: Accepted

Solution code:
N = int(input())
ls = set()
for i in range(N):
  ls.add(input())
print(len(ls))

Submission status: Accepted

Solution code:
N = int(input())
prize = set()
for i in range(N):
    p = input()
    prize.add(p)
    
print(len(prize))

Submission status: Accepted

Solution code:
N=int(input())
a=set()
for i in range(N):
    S=input()
    a.add(S)
print(len(a))