#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long linf = 1LL << 62;
const double PI = acos(-1.0), dinf = (double)(1LL << 62), eps = (double)(1e-9);
double distance(double x1, double y1, double x2, double y2) {
  x1 -= x2;
  y1 -= y2;
  return sqrt(x1 * x1 + y1 * y1);
}
long long POW(long long b, long long p) {
  if (p == 0) return 1;
  long long t = POW(b, p >> 1);
  if (p & 1) return t * t * b;
  return t * t;
}
long long bigmod(long long b, long long p, long long m) {
  if (p == 0) return 1;
  long long t = POW(b, p >> 1) % m;
  t = (t * t) % m;
  if (p & 1) t = (t * b) % m;
  return t;
}
inline int getint() {
  int x;
  scanf("%d", &x);
  return x;
}
inline long long getlng() {
  long long x;
  scanf("%lld", &x);
  return x;
}
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
int dx4[] = {-1, 0, 1, 0};
int dy4[] = {0, 1, 0, -1};
int dx8[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int main() {
  int n;
  while (cin >> n) {
    vector<int> a(n), b(n);
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
    }
    for (int i = 0; i < n; ++i) {
      cin >> b[i];
    }
    int cna[6], cnb[6];
    memset(cna, 0, sizeof cna);
    ;
    memset(cnb, 0, sizeof cnb);
    ;
    for (int i = 0; i < n; ++i) {
      cna[a[i]]++;
    }
    for (int i = 0; i < n; ++i) {
      cnb[b[i]]++;
    }
    int ans = 0;
    for (int i = 1; i <= 5; ++i) {
      int d = abs(cna[i] - cnb[i]);
      if (d & 1) {
        cout << -1;
        return 0;
      }
      ans += (d >> 1);
    }
    cout << ans / 2 << endl;
  }
  return 0;
}
