#include <iostream>
using namespace std;

const int MAX_LENGTH = 10;
const int TEN = 10;

int main() {
	int n;
	cin >> n;
	int freq[TEN] = {0};
	for (int i = 1; i <= n; ++i) {
		int no;
		cin >> no;
		while (no) {
			++freq[no % TEN];
			no /= TEN;
		}
	}
	int counter1 = 0;
	for (int i = 0; i < TEN; ++i) {
		if (freq[i] == 0) {
			++counter1;
		}
	}
	for (int i = 1; i <= n; ++i) {
		int no;
		cin >> no;
		while (no) {
			if (freq[no % TEN] != 0) {
				--freq[no % TEN];
			}
			no /= TEN;
		}
	}	
	int countPairs = 0;
	for (int i = 0; i < TEN; ++i) {
		if (freq[i] == 0) {
			++countPairs;
		}
	}
	cout << countPairs - counter1;
	return 0;
}//