Eric has been challenged by his friends to yet another round of WhenTaken, the popular game where players guess when and where a picture was taken.
The Amplitude group has gotten so good at WhenTaken that they always get the location correct, so now they are refining their ability to guess the year that a picture was taken. Pictures can taken in any year from to , and guesses can be any integer from to . If a picture was taken in year and the group guesses that it was taken in year , then the group gets penalty points.
Eric remembers every year that was guessed as well as the year of every picture in the last round of WhenTaken, but he does not remember which guess was for which picture. He wants to know the minimum and maximum number of penalty points that the group could have gotten.
Constraints
Input Specification
The first line of input contains a single integer, .
The second line of input contains integers, the years of the pictures in the last round.
The third line of input contains integers, the guesses made by the group.
Output Specification
Output two integers, the minimum possible number of penalty points and the maximum possible number of penalty points.
Sample Input 1
2
1 2
1 2
Sample Output 1
0 2
Sample Explanation 1
If both guesses were correct, then the group got penalty points. However, if both guesses were incorrect, then the group got penalty points.
Sample Input 2
3
31 41 59
27 18 28
Sample Output 2
1326 1886
Sample Explanation 2
The minimum penalty point count is obtained with . The maximum penalty point count is obtained with .
Comments