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,*l=open(0).read().split()
print(len(set(l)))

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 numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def main():
    N = int(input())
    S = [input().rstrip() for i in range(N)]

    Sset = set(S)

    res = len(Sset)

    print(res)



main()

Submission status: Accepted

Solution code:
inputs = open(0).readlines()
n = int(inputs[0])
S = [s.strip() for s in inputs[1:]]
print(len(set(S)))

Submission status: Accepted

Solution code:
import collections


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

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

    group = collections.Counter(S)

    ans = 0
    for key in list(group):
        ans += 1

    print(ans)


resolve()

Submission status: Accepted

Solution code:
s = list(map(int, input().split()))
n=s[0]
di={}
for i in range(n):
    s = input().split()
    di[s[0]]=0
print(len(di))

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:
#!/usr/local/bin/python3

from sys import stdin
import sys

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


print(len(set(S)))

Submission status: Accepted

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

    print(len(s))

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

S = [input() for i in range(N)]
c = collections.Counter(S)
ans = len(c.keys())
print(ans)

Submission status: Accepted

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

from collections import Counter
dic = Counter(s)

print(len(dic))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = int(input())

fruit = []
for i in range (A):
    S = str(input())
    fruit.append(S)
    
print(len(set(fruit)))

Submission status: Accepted

Solution code:
import collections
import sys
sys.setrecursionlimit(2000000)
# import math
# import itertools
# import statistics
# import numpy as np
n = int(input())
#a, b, c, d = list(map(int, input().split()))
#a = list(map(int, input().split()))
s = []
for i in range(n):
    s.append(input())

s_count = collections.Counter(s)

print(len(s_count))

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

import collections
c = collections.Counter(S)
print(len(c.keys()))

Submission status: Accepted

Solution code:
from collections import Counter

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

cnt = len(list(Counter(S).values()))

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

NList = []
for i in range(N):
    NList.append(input())
    
NList.sort()

count = 0
tmp = ''
for i in range(N):
    if tmp != NList[i]:
        count += 1
    tmp = NList[i]
       
print(count)

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools

#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

n = int(input())
S = [str(input()) for x in range(n)]
S_set = set(S)
ans = 0

print(len(S_set))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
ans = Counter(s)
print(len(ans))

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline

def main():
    N = int(readline())
    l = []
    for _ in range(N):
        l.append(readline()[:-1])
    s = set(l)
    ans = len(s)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

# from fractions import gcd
# from math import gcd

# def lcm(n, m):
#     return int(n * m / gcd(n, m))


# def coprimize(p, q):
#     common = gcd(p, q)
#     return (p // common, q // common)


# def find_gcd(list_l):
#     x = reduce(gcd, list_l)
#     return x


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
# gift = [list(map(str, input().split())) for _ in range(N)]
gift = list()
for i in range(N):
    gift.append(input())
gift_set = set(tuple(gift))
print(len(gift_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:
from collections import Counter

n = int(input())
c = Counter(input() for _ in range(n))
print(len(c))

Submission status: Accepted

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

ab = list(set(ab))
print(len(ab))

Submission status: Accepted

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

print(len(s))

Submission status: Accepted

Solution code:
# coding: utf-8
n = int(input())
dic = {}
for i in range(n):
    s = input()
    dic.setdefault(s, 1)
k = 0
for x in dic.values():
    k += x
print(k)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
#sys.setrecursionlimit(150000)


def solve(N: int, S: "List[str]"):
    k=set(S)
    print(len(k))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
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 = [str(input()) for _ in range(N)]
A = list(set(S))
print(len(A))

Submission status: Accepted

Solution code:
n=int(input())

item=dict()
count=0
for i in range(n):
  s=input()
  if item.get(s)==None:
    count+=1
    item[s]=1
  else:
    item[s]+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
ans = []
for i in range(N):
    ans.append(input())

C = Counter(ans)

print(len(set(ans)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
l = []
for i in range(N):
  l.append(input())
l = sorted(l)
ans = 1
for i in range(N-1):
  if l[i] != l[i+1]:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
dic = {}
for _ in range(N):
    dic.setdefault(input(), "hoge")

print(len(dic))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

S = []

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


print(len(set(S)))

Submission status: Accepted

Solution code:
N = int(input())

S_dict = dict()
for i in range(N):
    S = input()
    if S in S_dict:
        S_dict[S] += 1
    else:
        S_dict[S] = 1
        
print(len(S_dict))

Submission status: Accepted

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

print(len(set(Sli)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
## coding: UTF-8
from decimal import *
from itertools import permutations, combinations,combinations_with_replacement,product
import math


N = int(input())
l = []
for i in range(N):
    l.append(input())


l = sorted(l)

last = ''
counter = 0
for i in range(N):
    if(l[i] != last):
        counter += 1
    last = l[i]

print(counter)

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

Submission status: Accepted

Solution code:
def solve():
    ims = {}
    for itm in s:
        if not itm in ims:
            ims[itm]=1
    print(len(ims))
    return


n = int(input())
s = [input() for ii in range(n)]
solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    # An = list(map(int, input().split(' ')))
    An = []
    for _ in range(N):
        An.append(input())
        
    print(len(set(An)))
    

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

print(count)

Submission status: Accepted

Solution code:
def abc164_c():
  n = int(input())
  S = [str(input()) for _ in range(n)]
  ans = len(set(S))
  print(ans)

abc164_c()

Submission status: Accepted

Solution code:
from sys import stdin

def main():
    n = int(input())
    lst = list(set([stdin.readline()[:-1] for _ in range(n)]))
    print(len(lst))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
Ss = []
for i in range(N):
    s = stdin.readline().rstrip()
    Ss.append(s)

print(len(set(Ss)))

Submission status: Accepted

Solution code:
from collections import defaultdict

if __name__ == "__main__":
    n = int(input())
    s = list()
    for i in range(n):
        s.append(input())

    prise = defaultdict(int)

    for ss in s:
        prise[ss] += 1

    print(len(prise))

Submission status: Accepted

Solution code:
n = int(input())
kind = set()

for i in range(n):
  kind.add(input())

print(len(kind))

Submission status: Accepted

Solution code:
import sys
import math
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix
import itertools
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = []
for i in range(N):
    tmp = input()
    S.append(tmp)

c = Counter(S)
print(len(c))

Submission status: Accepted

Solution code:
import sys
import math

from collections import Counter

# input処理を高速化する
input = sys.stdin.readline

N=int(input())
Keihin =[]
for i in range(N):
    syouhin = input()
    Keihin.append(syouhin)

c=Counter(Keihin)
print(len(list(c.keys())))

Submission status: Accepted

Solution code:
"""
    Template written to be used by Python Programmers.
    Use at your own risk!!!!
    Owned by enraged(rating - 5 star at CodeChef and Specialist at Codeforces).
"""
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from fractions import Fraction
# sys.setrecursionlimit(2*pow(10, 6))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(var): sys.stdout.write(str(var))
def outln(var): sys.stdout.write(str(var)+"\n")
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


dp = dd(int)
for i in range(int(data())):
    dp[data()] += 1
outln(len(dp))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve(s):
    return len(set(s))


if __name__ == "__main__":
    print(solve([input() for x in range(int(input()))]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
items = Counter([input() for _ in range(n)])

print(len(items))

Submission status: Accepted

Solution code:
n = int(input())

a = {}

for _ in range(n):
  s = input()
  a[s] = a.get(s, 0) + 1
  
print(len(a.keys()))

Submission status: Accepted

Solution code:
import math
import queue

def readInt():
	return int(input())

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

def readChars():
	return input().split()

n = readInt()
s = []
for _i in range(n):
	s.append(input())

print(len(set(s)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import collections


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


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


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
n=int(input())
L=list(input() for i in range(n))
print(len(set(L)))

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
n_list = []
for i in range(N):
    n_list.append(input())
print(len(dict(Counter(n_list))))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n = inn()
s = set([])
for i in range(n):
    s.add(ins())
print(len(s))

Submission status: Accepted

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

unique = set()

for s in S:
    unique.add(s)

print(len(unique))

Submission status: Accepted

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


def solve(N: int, S: "List[str]"):
    print(len(list(set(S))))
    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 = []
for i in range(N):
  k = input()
  S.append(k)
Sset = set(S)
print(len(Sset))

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc164/tasks/abc164_c

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(2 * 10**6)


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


def main():
    N = int(input())
    Ss = [input().strip() for _ in range(N)]

    print(len(set(Ss)))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

S = {}

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

ans = 0
for i in S:
    ans += 1

print(ans)

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:
n = int(input())
re = set()
for k in range(n):
  re.add(input())

print(len(re))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    from sys import stdin
    input = stdin.readline

    n = int(input())
    a = set()
    for _ in range(n):
        a.add(input()[:-1])
    print(len(a))

Submission status: Accepted

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


def solve(N: int, S: "List[str]"):
    s = set()

    for i in S:
        s.add(i)
    
    print(len(s))

    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 = [str(input()) for _ in range(N)]

Set = set()

for i in range(N):
    Set.add(S[i])

print(len(Set))

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools

def solve():
  n = int(input())
  s = []
  for i in range(n):
    s.append(input())
  print(len(set(s)))
  return 0
 
if __name__ == "__main__":
  solve()

Submission status: Accepted

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

import sys 

input = sys.stdin.readline
for i in range(n):
  ls[i] = input()
  
print(len(set(ls)))

Submission status: Accepted

Solution code:
N = int(input())
P = {}
for _ in range(N):
  P[input()] = 1
print(sum(P.values()))

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

print(len(set(S)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
c = Counter()
n = int(input())
for _ in range(n):
    c[input()] += 1
print(len(c.keys()))

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    s=[]
    for i in range(n):
        s.append(STR())
    s=set(s)
    print(len(s))
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
n=int(input())

s=[]

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


a=set(s)

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:
if __name__ == '__main__':
    a = int(input())
    list = []

    for i in range(a):
        s = input()
        list.append(s)
    setList = set(list)
    print(len(setList))

Submission status: Accepted

Solution code:
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    S = isn(N)
    print(len(set(S)))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

keihin = set(s)
print(len(keihin))

Submission status: Accepted

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

ans=list(set(l))
print(len(ans))

Submission status: Accepted

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

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:
import time
startTimeProblem=time.time()

import fileinput, sys, itertools, functools
from math import *
from bisect import *
from heapq import *
from collections import *

def lcm(a, b):  
    return (a*b)/gcd(a, b)

class InputHelper:
    def __init__(self):
        self.myinput = fileinput.input()

    def isLocal(self):
        return not fileinput.isstdin()

    def int(self):
        return int(self.myinput.readline().rstrip())

    def ints(self):
        return [int(_) for _ in self.myinput.readline().rstrip().split()]

    def str(self):
        return self.myinput.readline().rstrip()

    def strs(self):
        return [_ for _ in self.myinput.readline().rstrip().split()]

class OutputHelper:
    def int(self, a):
        print(a)    

    def ints(self, a):  
        print(" ".join([str(_) for _ in a]))
    
    def intsNL(self, a):
        for _ in a:
            print(_)
    
    def str(self, s):
        print(s)

    def strs(self, s):
        print(" ".join([_ for _ in s]))

    def strsNL(self, s):
        for st in s:
            print(st)

class ListNode:
    def __init__(self, val):
        self.val = val
        self.next = None
        self.prev = None

In = InputHelper()
Out = OutputHelper()

######################################

N = In.int()

seen = set()
for _ in range(N):
    S = In.str()

    if S not in seen:
        seen.add(S)

Out.int(len(seen))

######################################

if len(sys.argv)>2 and sys.argv[2]=="TIMEIT":
    fin = (time.time()-startTimeProblem)*1000
    print("{:.2f}".format(fin) + "ms")

Submission status: Accepted

Solution code:
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
#%%code
def resolve():
    N,=pin()
    temp=[input() for i in range(N)]
    from collections import  Counter
    c=Counter(temp)
    print(len(c))
#%%submit!
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

res = set(s)
print(len(res))

Submission status: Accepted

Solution code:
import sys 
try:
    sys.stdin = open('input.txt', 'r') 
    sys.stdout = open('output.txt', 'w')
except:
    pass

# input = sys.stdin.readline
d = {}
for _ in range(int(input())):
	s = input()
	d[s] = 1
print(len(d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
alist = a = [input() for i in range(N)]
alist.sort()
p = 0
for i in range(N-1):
    if alist[i] != alist[i+1]:
        p = p +1
print(p+1)

Submission status: Accepted

Solution code:
n = int(input())
s = [input() for i in range(n)]
from collections import Counter
c=dict(Counter(s))
print(len(list(c.keys())))

Submission status: Accepted

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

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

    shurui = set(lst)
    print(len(shurui))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:


def solve():

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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


# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    n = input_int()
    s = set([input() for i in range(n)])

    print(len(s))


if __name__ == "__main__":
    main()