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.util.*;
import java.io.*;
import java.math.*;
public class CFA779 {
public static void main(String args[]) {
	InputReader in = new InputReader(System.in);
	//OutputStream outputStream = System.out;
	PrintWriter out = new PrintWriter(System.out);
	int n=in.nextInt();
	int ar1[]=new int[6];
	int ar2[]=new int[6];
	for(int i=0;i<n;i++)
	{
		int x=in.nextInt();
		ar1[x]++;
	}
	for(int i=0;i<n;i++)
	{
		int x=in.nextInt();
		ar2[x]++;
	}
	int ans=0;
	for(int i=1;i<6;i++)
	{
		int avg=0;
		int x=ar1[i];
		int y=ar2[i];
		if((x+y)%2!=0)
		{
			ans=-1;
			break;
		}
		else
			avg=(x+y)/2;
		//out.println(i+" "+avg);
		ans=ans+Math.max(x, y)-avg;
		
	}
	if(ans!=-1&&ans%2==0)
		out.println(ans/2);
	else
		out.println(-1);
	out.close();

}

int sieveOfEratosthenes(int n) {
	// Create a boolean array "prime[0..n]" and initialize
	// all entries it as true. A value in prime[i] will
	// finally be false if i is Not a prime, else true.
	boolean prime[] = new boolean[n + 1];
	for (int i = 0; i < n; i++)
		prime[i] = true;

	for (int p = 2; p * p <= n; p++) {
		// If prime[p] is not changed, then it is a prime
		if (prime[p] == true) {
			// Update all multiples of p
			for (int i = p * 2; i <= n; i += p)
				prime[i] = false;
		}
	}
	int c = 0;
	for (int i = 2; i <= n; i++) {
		if (prime[i] == true)
			c++;
	}
	return c;
	// Print all prime numbers
	/* for(int i = 2; i <= n; i++)
	 {
	     if(prime[i] == true)
	         System.out.print(i + " ");
	 }*/
}

static class Pair implements Comparable<Pair> {
	int u;
	int v;
	BigInteger bi;

	public Pair(int u, int v) {
		this.u = u;
		this.v = v;
	}

	public int hashCode() {
		int hu = (int) (u ^ (u >>> 32));
		int hv = (int) (v ^ (v >>> 32));
		return 31 * hu + hv;
	}

	public boolean equals(Object o) {
		Pair other = (Pair) o;
		return u == other.u && v == other.v;
	}

	public int compareTo(Pair other) {
		return Long.compare(u, other.u) != 0 ? Long.compare(u, other.u) : Long.compare(v, other.v);
	}

	public String toString() {
		return "[u=" + u + ", v=" + v + "]";
	}
}

static long modulo(long a, long b, long c) {
	long x = 1;
	long y = a;
	while (b > 0) {
		if (b % 2 == 1) {
			x = (x * y) % c;
		}
		y = (y * y) % c; // squaring the base
		b /= 2;
	}
	return x % c;
}

public static long getClosestK(long[] a, long x) {

	int low = 0;
	int high = a.length - 1;

	while (low <= high) {
		int mid = (low + high) / 2;

		// test lower case
		if (mid == 0) {
			if (a.length == 1) {
				return a[0];
			}

			return Math.min(Math.abs(a[0] - x), Math.abs(a[1] - x)) + x;
		}

		// test upper case
		if (mid == a.length - 1) {
			return a[a.length - 1];
		}

		// test equality
		if (a[mid] == x || a[mid + 1] == x) {
			return x;
		}

		// test perfect range.
		if (a[mid] < x && a[mid + 1] > x) {
			return Math.min(Math.abs(a[mid] - x), Math.abs(a[mid + 1] - x)) + x;
		}

		// keep searching.
		if (a[mid] < x) {
			low = mid + 1;
		} else {
			high = mid;
		}
	}

	throw new IllegalArgumentException("The array cannot be empty");
}

long factorial(long n, long M) {
	long ans = 1;
	while (n >= 1) {
		ans = (ans * n) % M;
		n--;
	}
	return ans;
}

static long gcd(long x, long y) {
	if (x == 0)
		return y;
	if (y == 0)
		return x;
	long r = 0, a, b;
	a = (x > y) ? x : y; // a is greater number
	b = (x < y) ? x : y; // b is smaller number
	r = b;
	while (a % b != 0) {
		r = a % b;
		a = b;
		b = r;
	}
	return r;
}

static class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;

	public InputReader(InputStream inputstream) {
		reader = new BufferedReader(new InputStreamReader(inputstream));
		tokenizer = null;
	}

	public String nextLine() {
		String fullLine = null;
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				fullLine = reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
			return fullLine;
		}
		return fullLine;
	}

	public String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}
}
}
