#include <bits/stdc++.h>
using namespace std;
long long cl(long long a, long long b) {
  if (a % b == 0)
    return a / b;
  else
    return a / b + 1;
}
long long max_div[1000001];
vector<long long> prs;
void sieve() {
  for (long long i = 2; i <= 1000000; i++) {
    if (!max_div[i]) {
      for (long long j = i; j <= 1000000; j += i) {
        max_div[j] = i;
      }
    }
  }
  for (long long i = 2; i < 1000001; i++) {
    if (max_div[i] == i) prs.push_back(i);
  }
}
void solve() {
  long long n;
  cin >> n;
  long long a[6], b[6];
  for (long long i = 0; i < 6; i++) a[i] = b[i] = 0;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    a[x]++;
  }
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    b[x]++;
  }
  long long ans = 0;
  for (long long i = 1; i <= 5; i++) {
    if ((a[i] + b[i]) & 1) {
      cout << -1 << endl;
      return;
    }
    if (a[i] > b[i]) {
      ans += a[i] - (a[i] + b[i]) / 2;
    }
  }
  cout << ans << endl;
}
int32_t main() {
  sieve();
  long long t = 1;
  for (long long i = 0; i < t; i++) solve();
  return 0;
}
