#include <bits/stdc++.h>
using namespace std;
int main() {
  int size, temp;
  cin >> size;
  vector<int> count1(5, 0), count2(5, 0);
  for (int i = 0; i < size; i++) {
    cin >> temp;
    count1[temp - 1]++;
  }
  for (int i = 0; i < size; i++) {
    cin >> temp;
    count2[temp - 1]++;
  }
  for (int i = 0; i < 5; i++) {
    if ((count1[i] + count2[i]) % 2) {
      cout << "-1" << endl;
      return 0;
    }
  }
  int min = 0;
  for (int i = 0; i < 5; i++) {
    min += abs(count1[i] - count2[i]);
  }
  if (min % 4) {
    cout << "-1" << endl;
    return 0;
  }
  cout << min / 4 << endl;
  return 0;
}
