using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using static Scanner;

class Solver
{
    static void Main(string[] args) {
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        Solve();
        Console.Out.Flush();
    }

    static void Solve() {
        var N = Scan<int>();
        var dict = new Dictionary<string, int>();
        for (int i = 0; i < N; i++) {
            var s = Scan<string>();
            if (!dict.ContainsKey(s)) dict.Add(s, 0);
            dict[s]++;
        }
        var M = Scan<int>();
        for (int i = 0; i < M; i++) {
            var t = Scan<string>();
            if (dict.ContainsKey(t)) dict[t]--;
        }
        var max = dict.Max(x => x.Value);
        Console.WriteLine(max < 0 ? 0 : max);
    }
}

class Scanner
{
    const int BUFFER_SIZE = 1024;
    const char SPACE = ' ', BEGIN = '!', END = '~', ZERO = '0', NINE = '9'; 
    static readonly Stream stdin = Console.OpenStandardInput();
    static readonly byte[] buffer = new byte[BUFFER_SIZE];
    static int size, p;
    static bool isEof;

    [MethodImpl(256)]
    private static byte Read() {
        if (isEof) return default;
        if (p < size) return buffer[p++];
        p = 0;
        if ((size = stdin.Read(buffer, 0, BUFFER_SIZE)) > 0) return buffer[p++];
        isEof = true;
        return 0;
    }
    [MethodImpl(256)]
    private static char Next() {
        byte b;
        do b = Read();
        while (b < BEGIN || END < b);
        return (char) b;
    }
    [MethodImpl(256)]
    private static string Str() {
        var list = new List<char> { Next() };
        for (var c = (char)Read(); BEGIN <= c && c <= END; c = (char)Read()) list.Add(c);
        return list.AsSpan().ToString();
    }
    [MethodImpl(256)]
    public static ReadOnlySpan<char> StrSpan() {
        var list = new List<char> {Next()};
        for (var c = (char) Read(); BEGIN <= c && c <= END; c = (char) Read()) list.Add(c);
        return list.AsSpan();
    }
    [MethodImpl(256)]
    private static int Int() {
        int tmp = Next() - ZERO;
        for (var c = (char) Read(); ZERO <= c && c <= NINE; c = (char) Read()) tmp = tmp * 10 + c - ZERO;
        return tmp;
    }
    [MethodImpl(256)]
    private static long Long() {
        long tmp = Next() - ZERO;
        for (var c = (char) Read(); ZERO <= c && c <= NINE; c = (char) Read()) tmp = tmp * 10 + c - ZERO;
        return tmp;
    }
    [MethodImpl(256)]
    private static double Double() => double.Parse(Str(), CultureInfo.InvariantCulture);
    [MethodImpl(256)]
    public static string ScanLine() {
        var sb = new StringBuilder();
        for (var c = Next(); SPACE <= c && c <= END; c = (char) Read()) sb.Append(c);
        return sb.ToString();
    }
    [MethodImpl(256)]
    public static T Scan<T>()
        => default(T) switch {
            int _ => (T) (object) Int(), long _ => (T) (object) Long(), double _ => (T) (object) Double(), _ => (T) (object) Str()};
    [MethodImpl(256)] public static (T, T) Dual<T>() => (Scan<T>(), Scan<T>());
    [MethodImpl(256)] public static (T, T, T) Tri<T>() => (Scan<T>(), Scan<T>(), Scan<T>());
    [MethodImpl(256)] public static (T, T, T, T) Quad<T>() => (Scan<T>(), Scan<T>(), Scan<T>(), Scan<T>());
    [MethodImpl(256)] public static (T, T, T, T, T) Quint<T>() => (Scan<T>(), Scan<T>(), Scan<T>(), Scan<T>(), Scan<T>());
    [MethodImpl(256)] public static (T1, T2) Scan<T1, T2>() => (Scan<T1>(), Scan<T2>());
    [MethodImpl(256)] public static (T1, T2, T3) Scan<T1, T2, T3>() => (Scan<T1>(), Scan<T2>(), Scan<T3>());
    [MethodImpl(256)] public static (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() => (Scan<T1>(), Scan<T2>(), Scan<T3>(), Scan<T4>());
    [MethodImpl(256)] public static (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() => (Scan<T1>(), Scan<T2>(), Scan<T3>(), Scan<T4>(), Scan<T5>());
    [MethodImpl(256)] public static (T1, T2, T3, T4, T5, T6) Scan<T1, T2, T3, T4, T5, T6>() => (Scan<T1>(), Scan<T2>(), Scan<T3>(), Scan<T4>(), Scan<T5>(), Scan<T6>());
}
static class ListExtention
{
    private abstract class Wrapper<T> { public readonly T[] Items; protected Wrapper(T[] items) => Items = items; }
    [MethodImpl(256)]
    public static Span<T> AsSpan<T>(this List<T> list) => Unsafe.As<Wrapper<T>>(list).Items.AsSpan(0, list.Count);
}

Measured memory_bytes: 24888