#include <bits/stdc++.h>
using namespace std;
int a[6], b[6], n;
void cit() {
  cin >> n;
  int nr;
  for (int i = 1; i <= n; i++) {
    cin >> nr;
    a[nr]++;
  }
  for (int i = 1; i <= n; i++) {
    cin >> nr;
    b[nr]++;
  }
}
void rez() {
  int cnt = 0;
  bool ok = false;
  for (int i = 1; i <= 5 && !ok; i++) {
    if ((max(a[i], b[i]) - min(a[i], b[i])) % 2 == 0)
      cnt += (max(a[i], b[i]) - min(a[i], b[i])) / 2;
    else
      ok = true;
  }
  cnt /= 2;
  if (!ok)
    cout << cnt;
  else
    cout << -1;
}
int main() {
  cit();
  rez();
  return 0;
}
