import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Scanner; public class j { Scanner in = new Scanner(System.in); public static void main(String[] args) { j myj = new j(); myj.go(); } public void go() { while(true) { HashMap hm = new HashMap(); int n = in.nextInt(); if(n == 0) break; for(int k = 0; k < n; k++) { String s = in.nextLine(); while(s.length() < 1) s = in.nextLine(); int count = 0; Integer i = hm.get(s); if(i != null) count = i; count++; hm.put(s, count); //System.out.println(s + " = " + count); } for(int k = 0; k < n; k++)//negate from the second list { String s = in.nextLine(); int count = 0; if(hm.get(s) != null) count = (int)hm.get(s); count--; hm.put(s, count); } int wrongs = 0; for (Integer i : hm.values()) { //System.out.println(i); if(i > 0) wrongs += i; } System.out.println(n - wrongs); } } }