#include <bits/stdc++.h>
using namespace std;
int main() {
  int size;
  cin >> size;
  vector<int> a(size);
  vector<int> b(size);
  vector<int> a1(5);
  vector<int> b1(5);
  vector<int> all(5);
  for (size_t i = 0; i < size; i++) {
    cin >> a[i];
    a1[a[i] - 1]++;
    all[a[i] - 1]++;
  }
  for (size_t i = 0; i < size; i++) {
    cin >> b[i];
    b1[b[i] - 1]++;
    all[b[i] - 1]++;
  }
  if (all[0] % 2 || all[1] % 2 || all[2] % 2 || all[3] % 2 || all[4] % 2) {
    cout << -1;
    return 0;
  }
  int J = abs(a1[0] - b1[0]) + abs(a1[1] - b1[1]) + abs(a1[2] - b1[2]) +
          abs(a1[3] - b1[3]) + abs(a1[4] - b1[4]);
  cout << J / 4;
}
