
if __name__ == '__main__':

    blue_dict = {}
    red_dict= {}

    N = int(input())
    for _ in range(N):
        key = input()
        if key in blue_dict.keys():
            blue_dict[key] += 1
        else:
            blue_dict[key] = 1
    
    M = int(input())
    for _ in range(M):
        key = input()
        if key in blue_dict.keys():
            blue_dict[key] -= 1
        else:
            blue_dict[key] = 0
    
    print(max(0, max(blue_dict.values())))
