n=int(eval(input()))

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

s.sort()

ans=n

for i in range(1,n):

  if s[i]==s[i-1]:

    ans-=1



print(ans)
import sys, bisect, math, itertools, string, queue, copy

import numpy as np

import scipy

from collections import Counter,defaultdict,deque

from itertools import permutations, combinations

from heapq import heappop, heappush

from fractions import gcd

input = sys.stdin.readline

sys.setrecursionlimit(10**8)

mod = 10**9+7

def inp(): return int(eval(input()))

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

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

def inpls(): return list(input().split())

def inplm(n): return list(int(eval(input())) for _ in range(n))

def inplL(n): return [list(eval(input())) for _ in range(n)]

def inplT(n): return [tuple(eval(input())) for _ in range(n)]

def inpll(n): return [list(map(int, input().split())) for _ in range(n)]

def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])



n = inp()

s = [eval(input()) for _ in range(n)]

s.sort()



ans = 1

for i in range(1,n):

    if s[i] != s[i-1]:

        ans += 1



print(ans)

n = int(eval(input()))
s = [eval(input()) for i in range(n)]
s.sort()
ans = n
for i in range(1, n):
    if s[i] == s[i - 1]:
        ans -= 1
print(ans)

import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter, defaultdict, deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd

input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9 + 7


def inp():
    return int(eval(input()))


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


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


def inpls():
    return list(input().split())


def inplm(n):
    return list(int(eval(input())) for _ in range(n))


def inplL(n):
    return [list(eval(input())) for _ in range(n)]


def inplT(n):
    return [tuple(eval(input())) for _ in range(n)]


def inpll(n):
    return [list(map(int, input().split())) for _ in range(n)]


def inplls(n):
    return sorted([list(map(int, input().split())) for _ in range(n)])


n = inp()
s = [eval(input()) for _ in range(n)]
s.sort()
ans = 1
for i in range(1, n):
    if s[i] != s[i - 1]:
        ans += 1
print(ans)

-n = int(eval(input())) -s = [eval(input()) for i in range(n)] +import sys, bisect, math, itertools, string, queue, copy +import numpy as np +import scipy +from collections import Counter, defaultdict, deque +from itertools import permutations, combinations +from heapq import heappop, heappush +from fractions import gcd + +input = sys.stdin.readline +sys.setrecursionlimit(10**8) +mod = 10**9 + 7 + + +def inp(): +    return int(eval(input())) + + +def inpm(): +    return list(map(int, input().split())) + + +def inpl(): +    return list(map(int, input().split())) + + +def inpls(): +    return list(input().split()) + + +def inplm(n): +    return list(int(eval(input())) for _ in range(n)) + + +def inplL(n): +    return [list(eval(input())) for _ in range(n)] + + +def inplT(n): +    return [tuple(eval(input())) for _ in range(n)] + + +def inpll(n): +    return [list(map(int, input().split())) for _ in range(n)] + + +def inplls(n): +    return sorted([list(map(int, input().split())) for _ in range(n)]) + + +n = inp() +s = [eval(input()) for _ in range(n)] -ans = n +ans = 1 -    if s[i] == s[i - 1]: -        ans -= 1 +    if s[i] != s[i - 1]: +        ans += 1