#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, res = 0, j, mid, a[6] = {}, b[6] = {};
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> j;
    a[j]++;
  }
  for (i = 0; i < n; i++) {
    cin >> j;
    b[j]++;
  }
  for (i = 1; i < 6; i++) {
    mid = a[i] + b[i];
    if (mid % 2) {
      cout << -1 << endl;
      return 0;
    }
    res += abs(a[i] - mid / 2);
  }
  cout << res / 2 << endl;
  return 0;
}
