#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int numStd, sum = 0, j = 1, cont = 0;
  bool flag = 1;
  scanf("%lld", &numStd);
  long long int stdA[numStd];
  long long int stdB[numStd];
  long long int qtdA[6] = {0};
  long long int qtdB[6] = {0};
  for (long long int i = 0; i < numStd; i++) {
    scanf("%lld", &stdA[i]);
    qtdA[stdA[i]]++;
  }
  for (long long int i = 0; i < numStd; i++) {
    scanf("%lld", &stdB[i]);
    qtdB[stdB[i]]++;
  }
  while (j < 6 && flag) {
    sum = qtdA[j] + qtdB[j];
    if (sum % 2 == 1) {
      cout << "-1\n";
      return 0;
    } else {
      cont += abs(qtdA[j] - qtdB[j]) / 2;
      j++;
    }
  }
  cout << cont / 2 << "\n";
}
