import java.util.Scanner;
public class Main {
public static void main
(String[] args
) { Scanner scanner
= new Scanner
(System.
in); int n = scanner.nextInt();
int[] array = new int[n];
for (int i = 0; i < n; i++) {
array[i] = scanner.nextInt();
}
int q = scanner.nextInt();
for (int i = 0; i < q; i++) {
int query = scanner.nextInt();
int count = 0;
for (int j = 0; j < n; j++) {
if (array[j] == query) {
count++;
}
}
}
}
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwogCnB1YmxpYyBjbGFzcyBNYWluIHsKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICBTY2FubmVyIHNjYW5uZXIgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwogICAgICAgIGludCBuID0gc2Nhbm5lci5uZXh0SW50KCk7CiAKICAgICAgICBpbnRbXSBhcnJheSA9IG5ldyBpbnRbbl07CiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICAgICAgYXJyYXlbaV0gPSBzY2FubmVyLm5leHRJbnQoKTsKICAgICAgICB9CiAKICAgICAgICBpbnQgcSA9IHNjYW5uZXIubmV4dEludCgpOwogCiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBxOyBpKyspIHsKICAgICAgICAgICAgaW50IHF1ZXJ5ID0gc2Nhbm5lci5uZXh0SW50KCk7CiAKICAgICAgICAgICAgaW50IGNvdW50ID0gMDsKICAgICAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBuOyBqKyspIHsKICAgICAgICAgICAgICAgIGlmIChhcnJheVtqXSA9PSBxdWVyeSkgewogICAgICAgICAgICAgICAgICAgIGNvdW50Kys7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKGNvdW50KTsKICAgICAgICB9CiAgICB9CiAgICAKICAgIH0K