#C562. Unique Stamp Collection

    ID: 49289 Type: Default 1000ms 256MiB

Unique Stamp Collection

Unique Stamp Collection

Alice is an enthusiastic stamp collector. She currently owns (n) unique stamps, each identified by a country code. Today, she purchased (m) new stamps, but she only wants to add those stamps to her collection that are not already owned. Given the two sets of stamps, compute the maximum number of new unique stamps she can add. Formally, let the set of her current stamps be (S) and the set of new stamps be (N). The answer is given by (|N \setminus S|).

inputFormat

The input is read from standard input and has the following format:

• The first line contains a single integer (n), the number of stamps currently held by Alice.
• The second line contains (n) space-separated integers representing the country codes of the current stamps. (If (n = 0), this line may be empty.)
• The third line contains a single integer (m), the number of new stamps purchased.
• The fourth line contains (m) space-separated integers representing the country codes of the new stamps.

outputFormat

Output a single integer which is the maximum number of new unique stamps that Alice can add to her collection. The output is written to standard output.## sample

5
1 2 3 4 5
3
2 6 7
2