#include <bits/stdc++.h>
using namespace std;
class Task {
 public:
  void solve(istream &in, ostream &out) {
    int n, tmp;
    vector<int> groupA;
    vector<int> groupB;
    vector<int> performanceCnt = vector<int>(5, 0);
    in >> n;
    for (int i = 0; i < n; i++) {
      in >> tmp;
      groupA.push_back(tmp);
    }
    for (int i = 0; i < n; i++) {
      in >> tmp;
      groupB.push_back(tmp);
    }
    for (int i = 0; i < groupA.size(); i++) {
      performanceCnt[groupA[i] - 1]++;
    }
    for (int i = 0; i < groupB.size(); i++) {
      performanceCnt[groupB[i] - 1]--;
    }
    int sum = 0;
    for (int i = 0; i < performanceCnt.size(); i++) {
      if (performanceCnt[i] % 2 != 0) {
        out << "-1";
        return;
      }
      sum += abs(performanceCnt[i]);
    }
    sum = sum / 4;
    out << sum;
  }
};
int main() {
  istream &in(cin);
  ostream &out(cout);
  Task t;
  t.solve(in, out);
  return 0;
}
