#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<long long> a(n), b(n);
  map<long long, long long> ma, mb;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ma[a[i]]++;
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    mb[b[i]]++;
  }
  int count = 0;
  for (int i = 1; i <= 5; i++) {
    if ((ma[i] + mb[i]) % 2 != 0) {
      cout << -1 << endl;
      return 0;
    }
    count += abs(ma[i] - (ma[i] + mb[i]) / 2);
  }
  cout << count / 2 << endl;
  return 0;
}
