#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <string.h>
#include <stack>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
typedef long long ll;
typedef pair<int,int> P;
int main() {
    int n,m;
    cin >> n;
    map<string, int>blue;
    map<string, int>red;
    rep(i, 0, n){
        string in;
        cin >> in;
        blue[in]++;
    }
    cin>>m;
    rep(i, 0, m){
        string in;
        cin >> in;
        red[in]++;
    }
    int ans = 0;
    for(auto i: blue){
        int blucnt =i.second;
        if(red[i.first] != 0){
            blucnt-=red[i.first];
        }
        ans = max(ans, blucnt);
    }
    cout << ans << endl;
    return 0;
}

#include <iostream>
using namespace std;

int main(){
	int sales_sum[10];
	int n;
	int sales;
	
	for(;;){
		for(int i = 0; i < 10; i++){
			sales_sum[i] = 0;
		}
		cin >> n;
		if(n == 0) break;
		for(int i = 0; i < n; i++){
			cin >> sales;
			sales_sum[sales]++;
		}
		for(int i = 0; i < 10; i++){
			if(sales_sum[i] == 0){
				cout << '-' << endl;
				continue;
			}
			for(int j = 0; j < sales_sum[i]; j++){
				cout << '*';
			}
			cout << endl;
		}
	}
	
	return 0;
}
		
	
	