#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int c1[5], c2[5], t[5];
  for (int i = 0; i < 5; ++i) {
    c1[i] = 0;
    c2[i] = 0;
    t[i] = 0;
  }
  for (int i = 0; i < n; ++i) {
    int a;
    scanf("%d", &a);
    c1[--a]++;
    t[a]++;
  }
  for (int i = 0; i < n; ++i) {
    int a;
    scanf("%d", &a);
    c2[--a]++;
    t[a]++;
  }
  for (int i = 0; i < 5; ++i) {
    if (t[i] % 2 > 0) {
      printf("-1\n");
      return 0;
    }
  }
  int d = 0;
  for (int i = 0; i < 5; ++i) {
    d += abs(c1[i] - t[i] / 2);
  }
  printf("%d\n", d / 2);
  return 0;
}
