import java.util.*; import java.io.*; public class j { Scanner in = new Scanner(System.in); // static Scanner in = null; public static void main(String[] args) { // ////erase for real // try{ // File file = new File("input.txt"); // in = new Scanner(file); // } catch(FileNotFoundException e) { // System.out.println("exception"); // } // //// new j().go(); } private void go() { int n = in.nextInt(); Map dom = new HashMap(); for (int i = 0; i < n; i++) { String key = in.next(); if(dom.containsKey(key)) { int val = dom.get(key) + 1; dom.put(key, val); } else { dom.put(key, 1); } } Map kattis = new HashMap(); for (int i = 0; i < n; i++) { String key = in.next(); if(kattis.containsKey(key)) { int val = kattis.get(key) + 1; kattis.put(key, val); } else { kattis.put(key, 1); } } int result = 0; for (String key : dom.keySet()) { if(kattis.containsKey(key)) { if(dom.get(key) < kattis.get(key)) { result = result + dom.get(key); } else { result = result + kattis.get(key); } } } System.out.println(result); } }