#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  std::vector<int> a(5, 0), b(5, 0);
  int x;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x);
    ++a[x - 1];
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x);
    ++b[x - 1];
  }
  int res = 0;
  for (int i = 0; i < 5; ++i) {
    if (((a[i] + b[i]) & 1) != 0) {
      printf("-1");
      return 0;
    }
    res += abs(a[i] - b[i]);
  }
  printf("%d", res / 4);
}
