#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, cnt = 0, a, b, c, m;
  cin >> n;
  vector<int> v1, v2;
  for (int i = 0; i < n; i++) {
    cin >> a;
    v1.push_back(a);
  }
  for (int i = 0; i < n; i++) {
    cin >> a;
    v2.push_back(a);
  }
  for (int i = 1; i <= 5; i++) {
    a = count(v1.begin(), v1.end(), i);
    b = count(v2.begin(), v2.end(), i);
    if ((a + b) % 2 == 1)
      return cout << -1 << endl, 0;
    else {
      cnt += abs(a - b);
    }
  }
  cout << cnt / 4 << endl;
}
