PROXY - Mandatory Attendance

no tags 

Problem Statement

Little John and his friends are very upset. For some strange reason, mandatory attendance has been suddenly introduced at their school, and it has been announced that each student needs to have a minimum of 80% attendance. All students who fail to achieve this minimum attendance would not be allowed to go for the school picnic.

Now the school picnic is one of the most awaited events of the year, and none of the students wants to miss it. However, many of the students find it very difficult to consistently attend all the lectures, especially the 8:30 morning ones. So, these students decide to ask some of their more sincere friends, who attend lectures more or less regularly, to mark a proxy for them in case of their absence.

Now this sounds like a foolproof idea ( since the teachers have no TAs and are too busy to manually check for proxies ). However, unfortunately, although some students are present in the class, they are unable to stay awake, and so, fail to mark their attendance on the sheet when it is passed around.You are given a list of students who were present in the class, as well as all the names signed on the attendance sheet. Your task is to figure out the number of proxies entered, as well as the number of students who were sleeping during the lecture. ( Those who were present, but did not mark their attendance ).  

Input

The first line contains the single integer N ( 1 <= N <= 100000 ), the number of students actually present in the class.

N lines of input follow, each containing a single uppercase string - the list of names of students who were actually present during the lecture.

Next we have a line containing the single integer M ( 0 <= M <= 100000 ), the number of names signed on the attendance sheet.

M lines of input follow each containing a single uppercase string - the list of signatures on the attendance sheet.

 

Output

The output consists of 2 lines.On the first line print the number of proxies entered.On the second line print the number of students sleeping in the class ( those who were present but did not mark their attendance ).

Note :  It is guaranteed that all the strings consist of uppercase characters only. Furthermore, it is also guaranteed that the names of all the students are unique, that is, there are no duplicate strings in either of the two lists. Also, the length of each name is atmost 10 characters  

Example

Input :

5

LUNA

HERMIONE

RON

GINNY

NEVILE

6

GINNY

DRACO

HARRY

HERMIONE

NEVILE

CEDRIC

 

Output :

3

2

 

Explanation :

- LUNA - Present, but sleeping

- HERMIONE - Present and awake

- RON - Present, but sleeping

- GINNY - Present and awake

- NEVILE - Present and awake

- DRACO, HARRY, CEDRIC - Not present, that is, proxy signatures



Added by:Gowri Sundaram
Date:2013-04-10
Time limit:2s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All