#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 * 5;
const int base = 1e9 + 7;
const int N = 5000;
int n;
int a[N], b[N];
int ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = (1); i <= (n); ++i) {
    int x;
    cin >> x;
    ++a[x];
  }
  for (int i = (1); i <= (n); ++i) {
    int x;
    cin >> x;
    ++b[x];
  }
  for (int i = (1); i <= (5); ++i)
    if ((a[i] + b[i]) & 1) {
      cout << -1;
      return 0;
    } else
      ans += (a[i] + b[i]) / 2 - min(a[i], b[i]);
  cout << ans / 2 << '\n';
  return 0;
}
