#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin
stdin.readline()
s = {int(s) for s in stdin.readline().split()}
stdin.readline()
s.intersection_update((int(s) for s in stdin.readline().split()))
print(len(s)) from __future__ import division, print_function from sys import stdin stdin.readline() stdin.readline stdin readline int(s) for s in stdin.readline().split() for s in stdin.readline().split() s stdin.readline().split() stdin.readline().split stdin.readline() stdin.readline stdin readline split for s in stdin.readline().split() int(s) int s s = {int(s) for s in stdin.readline().split()} s stdin.readline() stdin.readline stdin readline int(s) for s in stdin.readline().split() for s in stdin.readline().split() s stdin.readline().split() stdin.readline().split stdin.readline() stdin.readline stdin readline split for s in stdin.readline().split() int(s) int s s.intersection_update((int(s) for s in stdin.readline().split())) s.intersection_update s intersection_update (int(s) for s in stdin.readline().split()) print(len(s)) print len(s) len s s = {int(s) for s in stdin.readline().split()} s
#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin
stdin.readline()
s = {int(s) for s in stdin.readline().split()}
stdin.readline()
s.intersection_update((int(s) for s in stdin.readline().split()))
print(len(s))