In Berland each high school student is characterized by academic performance — integer value between 1 and 5.

In high school 0xFF there are two groups of pupils: the group A and the group B. Each group consists of exactly n students. An academic performance of each student is known — integer value between 1 and 5.

The school director wants to redistribute students between groups so that each of the two groups has the same number of students whose academic performance is equal to 1, the same number of students whose academic performance is 2 and so on. In other words, the purpose of the school director is to change the composition of groups, so that for each value of academic performance the numbers of students in both groups are equal.

To achieve this, there is a plan to produce a series of exchanges of students between groups. During the single exchange the director selects one student from the class A and one student of class B. After that, they both change their groups.

Print the least number of exchanges, in order to achieve the desired equal numbers of students for each academic performance.

Input

The first line of the input contains integer number n (1 ≤ n ≤ 100) — number of students in both groups.

The second line contains sequence of integer numbers a1, a2, ..., an (1 ≤ ai ≤ 5), where ai is academic performance of the i-th student of the group A.

The third line contains sequence of integer numbers b1, b2, ..., bn (1 ≤ bi ≤ 5), where bi is academic performance of the i-th student of the group B.

Output

Print the required minimum number of exchanges or -1, if the desired distribution of students can not be obtained.

Examples

Input

4
5 4 4 4
5 5 4 5


Output

1


Input

6
1 1 1 1 1 1
5 5 5 5 5 5


Output

3


Input

1
5
3


Output

-1


Input

9
3 2 5 5 2 3 3 3 2
4 1 4 1 1 2 4 4 1


Output

4
import java.io.*;

public class Task779A {

    public static void main(String... args) throws NumberFormatException,
            IOException {
        Solution.main(System.in, System.out);
    }

    static class Scanner {

        private final BufferedReader br;
        private String[] cache;
        private int cacheIndex;

        Scanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
            cache = new String[0];
            cacheIndex = 0;
        }

        int nextInt() throws IOException {
            if (cacheIndex >= cache.length) {
                cache = br.readLine().split(" ");
                cacheIndex = 0;
            }
            return Integer.parseInt(cache[cacheIndex++]);
        }

        long nextLong() throws IOException {
            if (cacheIndex >= cache.length) {
                cache = br.readLine().split(" ");
                cacheIndex = 0;
            }
            return Long.parseLong(cache[cacheIndex++]);
        }

        String next() throws IOException {
            if (cacheIndex >= cache.length) {
                cache = br.readLine().split(" ");
                cacheIndex = 0;
            }
            return cache[cacheIndex++];
        }

        void close() throws IOException {
            br.close();
        }

    }

    static class Solution {

        public static void main(InputStream is, OutputStream os)
                throws NumberFormatException, IOException {
            PrintWriter pw = new PrintWriter(os);
            Scanner sc = new Scanner(is);


            int n = sc.nextInt();

            int a1 = 0;
            int a2 = 0;
            int a3 = 0;
            int a4 = 0;
            int a5 = 0;

            int b1 = 0;
            int b2 = 0;
            int b3 = 0;
            int b4 = 0;
            int b5 = 0;


            for (int i = 0; i < n; i++) {
                switch (sc.nextInt()) {
                    case 1:
                        a1++;
                        break;
                    case 2:
                        a2++;
                        break;
                    case 3:
                        a3++;
                        break;
                    case 4:
                        a4++;
                        break;
                    case 5:
                        a5++;
                        break;
                }
            }

            for (int i = 0; i < n; i++) {
                switch (sc.nextInt()) {
                    case 1:
                        b1++;
                        break;
                    case 2:
                        b2++;
                        break;
                    case 3:
                        b3++;
                        break;
                    case 4:
                        b4++;
                        break;
                    case 5:
                        b5++;
                        break;
                }
            }

            if ((a1 + b1) % 2 == 0 &&
                    (a2 + b2) % 2 == 0 &&
                    (a3 + b3) % 2 == 0 &&
                    (a4 + b4) % 2 == 0 &&
                    (a5 + b5) % 2 == 0) {

                int avg1 = (a1 + b1) / 2;
                int avg2 = (a2 + b2) / 2;
                int avg3 = (a3 + b3) / 2;
                int avg4 = (a4 + b4) / 2;
                int avg5 = (a5 + b5) / 2;

                int retVal = Math.abs(a1 - avg1) +
                        Math.abs(a2 - avg2) +
                        Math.abs(a3 - avg3) +
                        Math.abs(a4 - avg4) +
                        Math.abs(a5 - avg5);

                pw.println(retVal / 2);

            } else {
                pw.println(-1);
            }


            pw.flush();
            sc.close();

        }
    }

}