#include <iostream>
#include <cmath>

using namespace std;

int n, f[10]={0}, fa[10]={0}, fb[10]={0} ;

void process(){
	int res = 0;
	for (int i = 1; i <= 5; i++){
		res += abs(fa[i]-f[i]);
	}
	cout << res/2;
}

int main(){
	cin >> n;
	int t;
	for (int i = 1; i <= n; i++){
		cin >> t;
		f[t]++;
		fa[t]++;
	}
	for (int i = 1; i <= n; i++){
		cin >> t;
		f[t]++;
		fb[t]++;
	}
	for (int i = 1; i <= 5; i++){
		if (f[i]%2==1){
			cout << -1;
			return 0;
		}
	}
	for (int i = 1; i <= 5; i++){
		f[i]/=2;
	}
	process();
	return 0;
}