AtCoder Beginner Contest 164 - gacha

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-----
3
apple
orange
apple

-----Sample Output-----
2

You got two kinds of items: apple and orange.

Difficulty: EASY

Starter code:

Solutions:
n = int(input())
print(len(set((input() for _ in range(n)))))


A = int(input())
S = [input() for i in range(A)]
print(len(set(S)))


N = int(input())
A = [input() for n in range(N)]
print(len(set(A)))


n = input()
print(len(set((input() for num in range(int(n))))))


n = int(input())
print(len(set((input() for i in range(n)))))


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


n = int(input())
s = set((input() for i in range(n)))
ans = len(s)
print(ans)


n = int(input())
a = []
for i in range(n):
	a.append(input())
a.sort()
ans = 1
for i in range(n - 1):
	if a[i] != a[i + 1]:
		ans += 1
print(ans)


N = int(input())
S = [input() for _ in [0] * N]
print(len(set(S)))


N = int(input())
S = [input() for x in range(N)]
print(len(set(S)))


n = int(input())
s = {input() for sn in range(n)}
print(len(s))


N = int(input())
s = set()
for _ in range(N):
	S = input()
	s |= {S}
print(len(s))


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


import collections
N = int(input())
a = [input() for i in range(N)]
c = collections.Counter(a)
print(len(c))


N = int(input())
s = {input() for _ in range(N)}
print(len(s))


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


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


M = int(input())
P = [input() for i in range(M)]
print(len(set(P)))


N = int(input())
S = set()
for _ in range(N):
	S.add(input())
print(len(S))
return


n = int(input())
keihin = {}
for i in range(n):
	moji = str(input())
	keihin.setdefault(moji, 0)
	keihin[moji] += 1
print(len(keihin.keys()))


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


(_, *s) = open(0).read().split()
print(len(list(set(s))))


(n, *s) = open(0).read().split()
print(len(set(s)))


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


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


from typing import Set

def answer(n: int, s: Set[str]) -> int:
	return len(s)

def main():
	n = int(input())
	s = set((input() for _ in range(n)))
	print(answer(n, s))

def __starting_point():
	main()
__starting_point()


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


(_, *a) = open(0).read().split()
print(len(set(a)))


n = int(input())
p = {input() for i in range(n)}
print(len(p))


n = int(input())
s = {input() for _ in range(n)}
print(len(s))


import sys
from collections import deque, defaultdict, Counter
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush
from math import ceil, floor, sqrt, gcd, inf
from copy import deepcopy
import numpy as np
import scipy as sp
INF = inf
MOD = 1000000007
n = int(input())
S = [input() for j in range(n)]
tmp = 0
res = 0
tmp = Counter(S)
res = len(tmp)
print(res)


n = int(input())
all = {input() for _ in range(n)}
print(len(all))


print(len({input() for i in range(int(input()))}))


(n, *l) = open(0).read().split()
print(len(set(l)))


import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
input = sys.stdin.readline

def RD():
	return input().rstrip()

def F():
	return float(input().rstrip())

def I():
	return int(input().rstrip())

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

def MF():
	return map(float, input().split())

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

def TI():
	return tuple(map(int, input().split()))

def LF():
	return list(map(float, input().split()))

def Init(H, W, num):
	return [[num for i in range(W)] for j in range(H)]

def main():
	N = I()
	D = defaultdict(int)
	ans = 0
	for i in range(N):
		temp = input().rstrip()
		if D[temp] == 0:
			D[temp] = 1
			ans += 1
	print(ans)

def __starting_point():
	main()
__starting_point()


N = int(input())
dic = {}
for i in range(N):
	s = str(input())
	if s not in dic:
		dic[s] = 'o'
print(len(dic))


n = int(input())
a = [input() for j in range(n)]
print(len(set(a)))


n = int(input())
a = set((input() for i in range(n)))
print(len(list(a)))


N = int(input())
d = {}
for _ in range(N):
	d[input()] = 1
print(len(d))


def main():
	n = int(input())
	seen = []
	for i in range(n):
		item = input()
		seen.append(item)
	return len(list(set(seen)))

def __starting_point():
	print(main())
__starting_point()


N = int(input())
S = []
for i in range(N):
	s = str(input())
	S.append(s)
T = set(S)
print(len(T))


a = int(input())
l = [input() for i in range(a)]
print(len(set(l)))


b = int(input())
l = {input() for _ in range(b)}
print(len(l))


a = [input() for N in range(int(input()))]
print(len(set(a)))


N = int(input())
X = set([input() for _ in range(N)])
print(len(X))


n = int(input())
s = [input() for _ in range(n)]
s.sort()
count = 1
for i in range(n - 1):
	if s[i] != s[i + 1]:
		count += 1
print(count)


def gacha():
	N = int(input())
	S = {input() for i in range(N)}
	print(len(S))
gacha()


print(len({*open(0).read().split()}) - 1)


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


N = int(input())
a = {input() for _ in range(N)}
print(len(a))


print(len(set(open(0).read().split('\n'))) - 2)


(N, *S) = open(0).read().split()
print(len(set(S)))


N = int(input())
S = [input() for i in range(N)]
T = set(S)
print(len(T))


N = int(input())
S = [str(input()) for i in range(N)]
gocha = {}
for s in S:
	gocha[s] = 1
print(len(gocha))


N = int(input())
S = {input() for _ in range(N)}
print(len(S))


N = int(input())
a = []
for i in range(N):
	a_temp = input()
	a.append(a_temp)
print(len(set(a)))


(N, *S) = open(0)
print(len(set(S)))


N = int(input())
list = {input() for _ in range(N)}
print(len(list))


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


import numpy as np
N = int(input())
data_list = []
for i in range(N):
	si = input()
	data_list.append(si)
data_list = np.array(data_list)
print(len(np.unique(data_list)))


N = int(input())
L = [input() for _ in range(N)]
print(len(set(L)))


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


import collections
n = int(input())
ss = [input() for i in range(n)]
c = collections.Counter(ss)
print(len(c))


n = int(input())
l = [''] * n
for i in range(n):
	l[i] = input()
print(len(list(set(l))))


time = int(input())
print(len(set((input() for i in range(time)))))


print(len(list(set([input() for _ in range(int(input()))]))))


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


N = int(input())
S = [input() for n in range(N)]
print(len(set(S)))


from collections import Counter
N = int(input())
S = []
for i in range(N):
	s = input()
	S.append(s)
S = Counter(S)
print(len(S))


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


(N, *S) = open(0).read().split()
s = list(set(S))
print(len(s))


n = int(input())
lst = {input() for i in range(n)}
print(len(lst))


n = int(input())
l = [input() for _ in [0] * n]
print(len(set(l)))


d = {}
for _ in range(int(input())):
	d[input()] = ''
print(len(d))


n = int(input())
s = {input() for z in range(n)}
print(len(s))


n = int(input())
L = list((input() for _ in range(n)))
UL = set(L)
print(len(UL))


N = int(input())
S = list(set((input() for i in range(N))))
print(len(S))


N = int(input())
S = [input() for _ in range(N)]
dic = {}
for i in range(N):
	dic[S[i]] = 0
print(len(list(dic.keys())))


print(len({input().strip() for _ in range(int(input().strip()))}))


num = int(input())
s = [input() for i in range(num)]
print(len(set(s)))


n = int(input())
s = [input() for i in [0] * n]
print(len(set(s)))


print(len(set([input() for x in range(int(input()))])))


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


N = int(input())
S = [input() for j in range(N)]
A = set(S)
print(len(A))


N = int(input())
se = set((input() for _ in range(N)))
print(len(se))


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


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


def __starting_point():
	n = int(input())
	ans = set()
	for s in range(n):
		cmd = input()
		ans.add(cmd)
	print(len(ans))
__starting_point()


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


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, bisect
import sys
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
stdin = sys.stdin
ni = lambda : int(ns())
nf = lambda : float(ns())
na = lambda : list(map(int, stdin.readline().split()))
nb = lambda : list(map(float, stdin.readline().split()))
ns = lambda : stdin.readline().rstrip()
N = ni()
d = {}
for i in range(N):
	S = ns()
	if S not in d.keys():
		d[S] = 1
	else:
		d[S] += 1
print(len(d))


N = int(input())
a = [input() for i in range(N)]
b = set(a)
print(len(b))


N = int(input())
prise = []
for _ in range(N):
	prise.append(input())
prise = list(set(prise))
print(len(prise))


N = int(input())
dics = {}
for _ in range(N):
	s = input()
	if s in dics:
		dics[s] += 1
	else:
		dics[s] = 1
print(len(dics.keys()))


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


d = {}
for i in range(int(input())):
	d[input()] = 1
print(len(d))


N = int(input())
S = [input() for i in range(N)]
K = set(S)
print(len(K))


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


n = int(input())
a = {input() for i in range(n)}
print(len(a))


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


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


n = int(input())
a = {}
for i in range(n):
	s = input()
	if s not in a:
		a[s] = 1
	else:
		a[s] += 1
print(len(a))


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


import sys
input()
print(len(set(sys.stdin.readlines())))


N = int(input())
S = set((str(input()) for i in range(N)))
print(len(S))


n = int(input())
s = {input() for i in range(n)}
print(len(s))


N = int(input())
res = {input() for _ in range(N)}
print(len(res))


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


N = int(input())
priseset = set()
for i in range(N):
	prise = input()
	priseset.add(prise)
print(len(priseset))


n = int(input())
ss = {input() for _ in range(n)}
print(len(ss))


N = int(input())
J = [input() for i in range(N)]
print(len(list(set(J))))


def i_input():
	return int(input())

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

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

def i_row(N):
	return [int(input()) for _ in range(N)]

def i_row_list(N):
	return [list(map(int, input().split())) for _ in range(N)]
n = i_input()
ss = [input() for _ in range(n)]
pr = set(ss)
print(len(pr))


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


(n, *a) = open(0).read().split()
print(len(set(a)))


print(len(set(open(0))) - 1)


n = int(input())
a = set()
for i in range(n):
	b = input()
	a.add(b)
print(len(a))


n = int(input())
dic = {}
ans = 0
for _ in range(n):
	x = input()
	if x not in dic:
		ans += 1
		dic[x] = 1
print(ans)


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


print(len({*open(0)}) - 1)


N = int(input())
s = [0] * N
for i in range(N):
	s[i] = input()
d = set()
for v in s:
	d.add(v)
print(len(d))


N = int(input())
S = set((str(input()) for _ in range(N)))
print(len(S))


N = int(input())
B = [input() for _ in range(N)]
print(len(set(B)))


N = int(input())
myset = set([])
for i in range(N):
	S = input()
	myset.add(S)
print(len(myset))


n = int(input())
myset = {input() for _ in range(n)}
print(len(myset))


N = int(input())
ls = {input() for i in range(N)}
print(len(ls))


n = int(input())
result_dict = {}
for i in range(n):
	n = input()
	if n in result_dict.keys():
		result_dict[n] += 1
	else:
		result_dict[n] = 0
print(len(result_dict.keys()))


N = int(input())
s = [input() for i in range(N)]
S = set(s)
print(len(S))


import collections
N = int(input())
S = [input() for _ in range(N)]
c = collections.Counter(S)
print(len(list(c.keys())))


N = int(input())
set_list = {}
for i in range(N):
	s = input()
	set_list[s] = True
print(len(set_list.keys()))


a = int(input())
b = [str(input()) for _ in range(a)]
print(len(set(b)))


N = int(input())
S = set()
count = 0
for _ in range(N):
	s = input()
	S.add(s)
print(len(S))


n = int(input())
ans = set()
for _ in range(n):
	ans.add(input())
print(len(ans))


N = int(input())
S = {input() for i in range(N)}
print(len(S))


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


N = int(input())
S = [input() for k in range(N)]
print(len(set(S)))


t = int(input())
s = [input() for i in range(t)]
print(len(set(s)))


N = int(input())
s = {input() for i in range(N)}
print(len(s))


N = int(input())
S = sorted([input() for _ in range(N)])
ans = 1
for i in range(N - 1):
	if S[i] != S[i + 1]:
		ans += 1
print(ans)


n = int(input())
a = set()
for i in range(0, n):
	lst = input()
	a.add(lst)
print(len(a))


n = int(input())
d = {}
for i in range(n):
	s = input()
	d[s] = d.get(s, 0) + 1
print(len(d))


N = int(input())
S = []
for i in range(N):
	S.append(str(input()))
S.sort()
ans = 1
for i in range(N - 1):
	if S[i] != S[i + 1]:
		ans += 1
print(ans)


print(len(set([input() for q in range(int(input()))])))


N = int(input())
rst = {input() for i in range(N)}
print(len(rst))


n = int(input())
s = set((str(input()) for i in range(n)))
print(len(s))


n = int(input())
p = set((input() for x in [0] * n))
print(len(p))


from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
counter = Counter(S)
print(len(list(counter.keys())))


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


n = int(input())
string_list = [input() for i in range(n)]
count = len(set(string_list))
print(count)


def __starting_point():
	n = int(input())
	A = []
	for _ in range(n):
		A.append(input())
	A.sort()
	ans = 1
	for i in range(n - 1):
		if A[i] != A[i + 1]:
			ans += 1
	print(ans)
__starting_point()


N = int(input())
s = [input() for i in range(N)]
r = set(s)
print(len(r))


N = int(input())
s = set([input() for x in range(N)])
print(len(s))


import sys
N = int(input())
reward = set()
for i in range(N):
	S = input()
	reward.add(S)
print(len(reward))


N = int(input())
S = [None] * N
for i in range(N):
	S[i] = input()
S = set(S)
print(len(S))


n = int(input())
d = {}
for _ in range(n):
	s = input()
	if not s in d.keys():
		d[s] = 1
print(len(d))


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


n = int(input())
s = list((input() for _ in range(n)))
keihin = set()
for i in s:
	keihin.add(i)
print(len(keihin))


N = int(input())
L = [input() for i in range(N)]
M = set(L)
print(len(M))


from collections import Counter
n = int(input())
string = [input() for i in range(n)]
string.sort()
i = Counter(string)
print(len(i))


N = int(input())
S = [input() for i in range(N)]
st = set(S)
print(len(st))