import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.range;
import std.stdio;
import std.string;

void main() {
  auto n = readln.chomp.to!int;
  auto s = readln.chomp.split.map!(to!int).array;
  auto q = readln.chomp.to!int;
  auto t = readln.chomp.split.map!(to!int).array;

  auto c = 0;

  foreach (e_t; t) {
    foreach (e_s; s) {
      if (e_t == e_s) {
	c++;
	break;
      }
    }
  }

  c.writeln;
}