#include <bits/stdc++.h>
using namespace std;
int main() {
  int bm[6], cm[6];
  memset(bm, 0, sizeof(bm));
  memset(cm, 0, sizeof(cm));
  int n, ans = 0;
  int b[110], c[110];
  scanf("%d", &n);
  bool p = true;
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    bm[b[i]]++;
  }
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    cm[c[i]]++;
  }
  for (int i = 1; i <= 5; i++) {
    if (bm[i] + cm[i] & 1) {
      p = false;
    } else {
      ans = ans + abs(bm[i] - cm[i]);
    }
  }
  if (p) {
    cout << ans / 4 << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
