#include <bits/stdc++.h>
using namespace std;
int a1, a2, a3, a4, a5, b1, b2, b3, b4, b5, a, b, c, d, e;
int main() {
  int i, n, cnt, num[210];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &num[i]);
    if (num[i] == 1)
      a1++;
    else if (num[i] == 2)
      a2++;
    else if (num[i] == 3)
      a3++;
    else if (num[i] == 4)
      a4++;
    else
      a5++;
  }
  while (i < 2 * n) {
    scanf("%d", &num[i]);
    if (num[i] == 1)
      b1++;
    else if (num[i] == 2)
      b2++;
    else if (num[i] == 3)
      b3++;
    else if (num[i] == 4)
      b4++;
    else
      b5++;
    i++;
  }
  a = a1 + b1;
  b = a2 + b2;
  c = a3 + b3;
  d = a4 + b4;
  e = a5 + b5;
  if (a % 2 == 0 && b % 2 == 0 && c % 2 == 0 && d % 2 == 0 && e % 2 == 0) {
    cnt = (abs(a / 2 - a1) + abs(b / 2 - a2) + abs(c / 2 - a3) +
           abs(d / 2 - a4) + abs(e / 2 - a5)) /
          2;
    printf("%d", cnt);
  } else
    printf("-1\n");
  return 0;
}
