iterator = [["NS", "S"], ["NT", "T"]]
var = {}
for i, j in iterator:
    var[i] = int(input())
    var[j] = [int(k) for k in input().split()]
res = 0
for T in var["T"]:
    if T in var["S"]:
        res += 1
print(res) iterator = [["NS", "S"], ["NT", "T"]] iterator [["NS", "S"], ["NT", "T"]] ["NS", "S"] "NS" "S" ["NT", "T"] "NT" "T" var = {} var {} for i, j in iterator:
    var[i] = int(input())
    var[j] = [int(k) for k in input().split()] i j iterator var[i] = int(input()) var[i] var i int(input()) int input() input int(k) for k in input().split() for k in input().split() k input().split() ().split () input split for k in input().split() int(k) int k var[j] = [int(k) for k in input().split()] var[j] var j [int(k) for k in input().split()] res = 0 res 0 for T in var["T"]:
    if T in var["S"]:
        res += 1 T var["T"] var "T" if T in var["S"]:
        res += 1 T in var["S"] T var["S"] var "S" res += 1 res 1 print(res) print res res += 1 1 res iterator = [["NS", "S"], ["NT", "T"]] [["NS", "S"], ["NT", "T"]] iterator res = 0 0 res var = {} {} var
iterator = [["NS", "S"], ["NT", "T"]]
var = {}
for i, j in iterator:
    var[i] = int(input())
    var[j] = [int(k) for k in input().split()]
res = 0
for T in var["T"]:
    if T in var["S"]:
        res += 1
print(res)