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:
def main():
    N = int(input())
    S = []
    for i in range(N):
        S.append(input())
    set_S = set(S)
    print(len(set_S))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

gacha_set = set()
for _ in range(n):
    s = input()
    gacha_set.add(s)

print(len(gacha_set))

Submission status: Accepted

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

print(len(set(S)))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
from collections import deque, Counter
import math
import pprint
from functools import reduce
# stdin = open("sample.txt")

MOD = 1000000007

def keta(kazu):
    kazu_str = str(kazu)
    kazu_list = [int(kazu_str[i]) for i in range(0, len(kazu_str))]
    return kazu_list

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def combination(m,n):
    if n > m:
        return 'すまん'
    return math.factorial(m) // (math.factorial(m-n) * math.factorial(n))

N = int(stdin.readline().rstrip())
result = []

while N > 0:
    result.append(stdin.readline().rstrip())
    N -= 1
    
ans = list(set(result))
print(len(ans))

Submission status: Accepted

Solution code:
n = int(input())
a = set()
for __ in range(n):
    a.add(input())
print(len(a))

Submission status: Accepted

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

print(len(s_set))

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 collections
n = int(input())

s = []

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

t = collections.Counter(s)
tt = list(t)

print(len(tt))

Submission status: Accepted

Solution code:
N = int(input())
items = {}
for i in range(N):
    a = str(input())
    items[a] = 0
print(len(items))

Submission status: Accepted

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

ans = set()
for i in range(N):
    ans.add(s[i])

print(len(ans))

Submission status: Accepted

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

import collections

c = collections.Counter(s)

print(len(c.keys()))

Submission status: Accepted

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

s=sorted(s)
for i in range(0,n-1):
    if s[i]!=s[i+1]:
        count+=1
print(count)

Submission status: Accepted

Solution code:
cnt = int(input())
gets = [input() for _ in range(cnt)]

gacha_set = set()
for g in gets:
  gacha_set.add(g)

print(len(gacha_set))

Submission status: Accepted

Solution code:
"""def power(x, y): 
    res = 1
    x=x
    while (y > 0): 
        if ((y & 1) == 1) : 
            res = (res * x) 
        y = y >> 1
        x = (x * x)
    return res""" 
"""def fact(n):
    if(n==0):
        return 1
    if(n==1):
        return 1
    return fact(n-1)+fact(n-2)"""

import math
#import combinations


t=int(input())
d={}
count=0
for _ in range(t):
    #n=int(input())
    s=input()
    #arr=list(map(int,input().split()))
    #b=list(map(int,input().split()))
    #d={}
    #flag=0
    #a,b,c,d=map(int,input().split())
    #count=0
    if s not in d:
        count+=1
        d[s]=1
    else:
        d[s]+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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 math import ceil

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

    S = [input() for i in range(N)]

    s = set()

    for i in S:
        s.add(i)

    print(len(s))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = []
while n > 0 :
    l.append(input())
    n -= 1

uniq = set(l)
print(len(uniq))

Submission status: Accepted

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

print(len(set(list)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

N = int(input())
S = [0]*N
for i in range(N):
    S[i] = input()
c = collections.Counter(S)

print(len(c.most_common()))

Submission status: Accepted

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

print(len(set(s)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

s = []

for _ in range(n):
    s.append(input())

s = set(s)

print(len(s))

Submission status: Accepted

Solution code:
N = int(input())

keihin = []

for i in range(N) :
  keihin.append(str(input()))
  
print(len(set(keihin)))

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())
dic = {}
for i in range(n):
    dic[input()] = 0
print(len(dic.keys()))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
S=['0']*N
for i in range(0,N):
    S[i]=input()
s=set(S)
print(len(s))

Submission status: Accepted

Solution code:
N=int(input())
S=list(str(input()) for i in range(N))
L=set(S)
print(len(L))

Submission status: Accepted

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

Submission status: Accepted

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

li = set(s)
print(len(li))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
ans = []
for i in range(n):
    s = input()
    ans.append(s)
answer = Counter(ans)
print(len(list(answer.keys())))

Submission status: Accepted

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

print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    N = int(input())
    S = list(input().strip() for _ in range(N))
    items = collections.Counter(S)
    print(len(items))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
  S = input()
  l.append(S)

print(len(list(set(l))))

Submission status: Accepted

Solution code:
n = int(input())

prize = set()
for i in range(n):
    prize.add(input())

print(len(prize))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

unbo = []


for i in range(n):
    unbo.append(input())

setList = set(unbo)

print(len(setList))

Submission status: Accepted

Solution code:
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N = read_int()[0]
S = [list(read_str().split())[0] for _ in range(N)]

def solve():
    return len(set(S))

if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

for i in range(n):
    s = str(input())
    #if (s in res) == False:
    res.append(s)

#print(len(res))
print(len(set(res)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

s=[0]*n

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


s_set=set(s)
ans=len(s_set)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())

dict = {}
for i in range(N):
    s=input()
    if s in dict:
        dict[s] += 1
    else:
        dict[s] = 1

print(len(dict))

Submission status: Accepted

Solution code:


n = 0
s = []

def format_input(filename = None):
	global n
	global s
	if filename == None:
		n = int(input())
		s = [str(input()) for i in range(n)]

	elif filename == '__random__':
		from random import randint as rng
		from random import choices
		n = rng(1, 2 * 10**5)
		s = [''.join(choices('abcdefghijklmnopqrstuvwxyz', k = rng(1, 10))) for i in range(n)]
		print(n)
		[print(s_i) for s_i in s]

def get_answer():
	answer = len(set(s))
	return answer

if __name__ == '__main__':
	format_input()

	ans = get_answer()
	print(ans)

Submission status: Accepted

Solution code:
n=int(input())
prise=['']*n
for i in range(n):
    prise[i]=input()
value=set(prise)
print(len(value))

Submission status: Accepted

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

print(len(set(s)))

Submission status: Accepted

Solution code:
from math import ceil
f=0
    # n=int(input())
    # a=list(map(int,input().split()))
    # c,d=map(int,input().split())
    
n=int(input())
m={}
for i in range(n):
    s=input()
    m[s]=1

print(len(m))

Submission status: Accepted

Solution code:
n=int(input())
a=set()
for i in range(n):
    x=str(input())
    a.add(x)
print(len(a))

Submission status: Accepted

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

Submission status: Accepted

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

print(len(set(s_list)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
s = set()

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

print(len(s))

Submission status: Accepted

Solution code:
n = int(input())

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

print(len(s))

Submission status: Accepted

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

##########
if __name__ == "__main__":
    c()

Submission status: Accepted

Solution code:
N = int(input())
s = list()
for a in range(N):
    s.append(input())

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

Submission status: Accepted

Solution code:
N=int(input())
S=[input() for _ in range(N)]
S.sort()
cnt=1
sb=S[0]
for s in S:
    if sb!=s:
        cnt+=1
    sb=s

print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter as Cnt
n=int(input())
s=[0]*n
for i in range(n):
    s[i]=input()
C=Cnt(s)

cnt = len(C.values())
print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter

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

Submission status: Accepted

Solution code:
from collections import defaultdict

N = int(input())
keihin = defaultdict(int)
for i in range(N):
    S = input()
    keihin[S] += 1
print(len(keihin))

Submission status: Accepted

Solution code:
N = int(input())

S = {}
for i in range(N):
    S[input()] = 1

print(len(S))

Submission status: Accepted

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

Submission status: Accepted

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

from collections import Counter
s_cnt = Counter(s)

ans = len(s_cnt)

print(ans)

Submission status: Accepted

Solution code:
def main():
    # import sys
    # input = sys.stdin.readline

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

    print(len(set(S)))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

prize = []

for i in range(n):
    prize.append(input())

prize_kind = set(prize)

print(len(prize_kind))

Submission status: Accepted

Solution code:
n = int(input())

arr = [input() for _ in range(n)]
dic={}
for i in range(n):
 if arr[i] not in dic:
   dic[arr[i]]=1

print(len(dic))

Submission status: Accepted

Solution code:
#C - gacha
N = int(input())
a = [str(input()) for i in range(N)]

print(len(set(a)))

Submission status: Accepted

Solution code:
from collections import defaultdict as dd
N=int(input())
a=[input() for _ in range(N)]
dic=dd(int)
for val in a:
    dic[val] += 1
print(len(dic.keys()))

Submission status: Accepted

Solution code:
import numpy as np
from collections import defaultdict
from math import gcd
import time
import sys
from collections import Counter
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
start = time.time()
N = int(input())
s = set()
for i in range(N):
    s.add(input())

print(len(s))

Submission status: Accepted

Solution code:
import collections
def slove(n, s):
    counter = collections.Counter()
    for i in s:
        counter[i] += 1


    ans = len(counter.keys())
    return ans

if __name__ == "__main__":

    n = int(input())
    s = [input() for i in range(n)]
    print(slove(n, s))

Submission status: Accepted

Solution code:

MOD = 10 ** 9 + 7

def main():
    for _ in inputt(1):
        n, = inputi()
        S = inputl(n, input)
        print(len(set(S)))

# region M


# region import
# 所有import部分

from math import *
from heapq import *
from itertools import *
from functools import reduce, lru_cache, partial
from collections import Counter, defaultdict
import re, copy, operator, cmath
import sys, io, os, builtins
sys.setrecursionlimit(1000)

# endregion

# region fastio

BUFSIZE = 8192
class FastIO(io.IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = io.BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(io.IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
def print(*args, **kwargs):
    if args:
        sys.stdout.write(str(args[0]))
        split = kwargs.pop("split", " ")
        for arg in args[1:]:
            sys.stdout.write(split)
            sys.stdout.write(str(arg))
    sys.stdout.write(kwargs.pop("end", "\n"))
def debug(*args, **kwargs):
    print("debug", *args, **kwargs)
    sys.stdout.flush()
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip()
inputt = lambda t = 0: range(t) if t else range(int(input()))
inputs = lambda: input().split()
inputi = lambda: map(int, inputs())
inputl = lambda t = 0, k = lambda: list(inputi()): [k() for _ in range(t)] if t else list(k())

# endregion

# region bisect

def len(a):
    if isinstance(a, range):
        return -((a.start - a.stop) // a.step)
    return builtins.len(a)
def bisect_left(a, x, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    if key == None: key = do_nothing
    while lo < hi:
        mid = (lo + hi) // 2
        if key(a[mid]) < x: lo = mid + 1
        else: hi = mid
    return lo
def bisect_right(a, x, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    if key == None: key = do_nothing
    while lo < hi:
        mid = (lo + hi) // 2
        if x < key(a[mid]): hi = mid
        else: lo = mid + 1
    return lo
def insort_left(a, x, key = None, lo = 0, hi = None):
    lo = bisect_left(a, x, key, lo, hi)
    a.insert(lo, x)
def insort_right(a, x, key = None, lo = 0, hi = None):
    lo = bisect_right(a, x, key, lo, hi)
    a.insert(lo, x)
do_nothing = lambda x: x
bisect = bisect_right
insort = insort_right
def index(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    if key == None: key = do_nothing
    i = bisect_left(a, x, key, lo, hi)
    if lo <= i < hi and key(a[i]) == x: return a[i]
    if default != None: return default
    raise ValueError
def find_lt(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_left(a, x, key, lo, hi)
    if lo < i <= hi: return a[i - 1]
    if default != None: return default
    raise ValueError
def find_le(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_right(a, x, key, lo, hi)
    if lo < i <= hi: return a[i - 1]
    if default != None: return default
    raise ValueError
def find_gt(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_right(a, x, key, lo, hi)
    if lo <= i < hi: return a[i]
    if default != None: return default
    raise ValueError
def find_ge(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_left(a, x, key, lo, hi)
    if lo <= i < hi: return a[i]
    if default != None: return default
    raise ValueError

# endregion

# region csgraph
# TODO

class Tree:
    def __init__(n):
        self._n = n
        self._conn = [[] for _ in range(n)]
        self._list = [0] * n
    def connect(a, b):
        pass

# endregion

# region ntheory
# TODO

class Sieve:
    def __init__(self):
        self._n = 6
        self._list = [2, 3, 5, 7, 11, 13]
    def extend(self, n):
        pass


sieve = Sieve()
def isprime(n):
    pass
def prime(n):
    pass
def factorint(n):
    factordict = defaultdict(int)
    for i in sieve:
        if n <= i * i:
            break
        while not n % i:
            factordict[i] += 1
            n //= i
    if n != 1:
        factordict[n] += 1
    return factordict

# endregion

# region main

if __name__ == "__main__":
    main()

# endregion


# endregion

Submission status: Accepted

Solution code:
n = int(input())
# = map(int, input().split())
# = list(map(int, input().split()))
s = [input() for _ in range(n)]
print(len(set(s)))

Submission status: Accepted

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


def main():
    n = int(si())
    strSet = set()
    for _ in range(n):
        s = si()[:-1]
        if s not in strSet:
            strSet.add(s)
    print(len(strSet))


if __name__ == '__main__':
    main()

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:
N = int(input())

S = set()
for i in range(N):
    item = input()
    if item not in S:
        S.add(item)

print(len(list(S)))

Submission status: Accepted

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

l.sort()
cnt=1
for i in range(1,n):
    if l[i] != l[i-1]:
        cnt += 1

print(cnt)

Submission status: Accepted

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

abset = set(ab)
print(len(abset))

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
t=int(input())
l=[]
for k in range(t):
    s=str(input())
    l.append(s)
l= list(dict.fromkeys(l))
print(len(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n= int(input())

s = set([])

for i in range(n):
    tmp = input()
    if tmp not in s:
        s.add(tmp)

print(len(s))

Submission status: Accepted

Solution code:
from collections import defaultdict
d = defaultdict(int)
s=[]
n=int(input())
for _ in range(n):
    s.append(input())
for i in range(n):
    d[s[i]]+=1
print(len(d))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [str(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))
n = i()
l = []
for i in range(n):
    k = input()
    l.append(k)
print(len(list(set(l))))

Submission status: Accepted

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

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

    s_li = []

    for i in range(n):
        s_i = input()
        s_li.append(s_i)

    print(len(set(s_li)))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

def main():
	inp=stdin.readline
	n=int(inp())
	s=set()
	for i in range(n):
		k=inp().strip()
		s.add(k)
	print(len(s))

main()

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
s = [input() for i in range(n)]
c = Counter(s)
print(len(c))

Submission status: Accepted

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

data = [0] * N
for i in range(N):
    data[i] = input()

d0 = Counter(data)
d1 = d0.most_common()
d2 = len(d1)
print(d2)

Submission status: Accepted

Solution code:
n=int(input())

keihin=[]

for i in range(n):
    keihin.append(input())

keihin.sort()


ans=n

for i in range(1,n):
    if(keihin[i]==keihin[i-1]):
        ans-=1

print(ans)

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())

dict = {}
for i in range(N):
	item = input()
	if item in dict.keys():
		dict[item] += 1
	else:
		dict[item] = 1

print(len(dict))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import deque

n=int(input())
p=[input() for _ in range(n)]
P=set(p)

print(len(P))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
di = {}
for i in range(n):
    s = input()
    if s in di:
        pass
    else:
        di[s] = 1

print(len(di))

Submission status: Accepted

Solution code:
n = int(input())
dic={}
for i in range(n):
  s = input()
  dic[s]=True
print(len(dic.keys()))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    S = {}
    for i in range(N):
        s = input()
        if s not in S:
            S.update({s:0})
    print(len(S))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    loop = int(input())
    s = set()
    for i in range(0, loop):
        s.add(input())
    print(len(s))




if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
S=set(list(input() for i in range(N)))

print(len(S))

Submission status: Accepted

Solution code:
#!/usr/bin python3
# -*- coding: utf-8 -*-

import sys
input = sys.stdin.readline

def main():
    N = int(input())
    a = set([])
    for i in range(N):
        a.add(input())
    print(len(a))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

n = int(sys.stdin.readline())
s_list = []
for i in range(n):
    s_list.append(sys.stdin.readline())

s = set(s_list)
print(len(list(s)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s_list = list()
for _ in range(n):
    s_list.append(input())
s_set = set(s_list)
print(len(s_set))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def run():
    n = int(stdin.readline().rstrip())
    data = [stdin.readline().rstrip() for _ in range(n)]

    print(len(set(data)))


if __name__ == '__main__':
    run()

Submission status: Accepted

Solution code:
N=int(input())
l=[input() for i in range(N)]
k=sorted(l)
cnt=1

for i in range(N-1):
    if k[i]!=k[i+1]:
        cnt+=1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Problem C
n = int(input())
kuji = []
for i in range(n):
    s = input()
    kuji.append(s)

print(len(set(kuji)))

Submission status: Accepted

Solution code:
N = int(input())

li = list()

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

set(li)

print(len(set(li)))

Submission status: Accepted

Solution code:
N = int(input())

W = []
for i in range(N):
  w = input()
  W.append(w)

Ws = set(W)
print(len(Ws))

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
dic={}
N=int(input())
a=0
for i in [0]*(N):
 b=input()
 if b in dic:
  continue
 else:
  a+=1
  dic[b]=1
print(a)

Submission status: Accepted

Solution code:
## C - gacha
N = int(input())
S = [str(input()) for s in range(N)]
print(len(set(S)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

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

c=collections.Counter(S)

print(len(c))

Submission status: Accepted

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

Submission status: Accepted

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

# input
n = int(input())
s = []
for i in range(n):
    tmp = input()
    s.append(tmp)

# calc
d = {}
for i in s:
    d[i] = True

print(len(d.keys()))

Submission status: Accepted

Solution code:
import collections

n = int(input())
s = []
for i in range(n):
    s.append(input())
c = collections.Counter(s)

print(len(c))

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    a = dict()
    for _ in range(int(input())):
        a[str(input())] = 1
    print(a.__len__())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


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


def resolve():
    n = int(input())
    s_list = []
    for _ in range(n):
        s_list.append(input().rstrip())

    s_set = set(s_list)

    print(len(s_set))


if __name__ == "__main__":
    resolve()

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:
n = int(input())
s = []
for _ in range(n):
    s.append(input())

s_set = set(s)
print(len(s_set))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())

d={}
r=0
for _ in range(a):
    b= input()
    if d.get(b): continue
    else: d[b]= True; r+=1

print(r)

Submission status: Accepted

Solution code:
N = int(input())

l = {}

for _ in range(N):
  key = input()
  l[key] = l.get(key, 0)
  
print(len(l))

Submission status: Accepted

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