#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, x[101], y[101], a = 0, b = 0, c = 0, d = 0, e = 0, A = 0, B = 0,
                               C = 0, D = 0, E = 0, ans;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x[i]);
    if (x[i] == 1)
      a++;
    else if (x[i] == 2)
      b++;
    else if (x[i] == 3)
      c++;
    else if (x[i] == 4)
      d++;
    else if (x[i] == 5)
      e++;
  }
  for (j = 0; j < n; j++) {
    scanf("%d", &y[j]);
    if (y[j] == 1)
      A++;
    else if (y[j] == 2)
      B++;
    else if (y[j] == 3)
      C++;
    else if (y[j] == 4)
      D++;
    else if (y[j] == 5)
      E++;
  }
  ans = abs(a - A) + abs(b - B) + abs(c - C) + abs(d - D) + abs(e - E);
  if (abs(a - A) % 2 != 0 || abs(b - B) % 2 != 0 || abs(c - C) % 2 != 0 ||
      abs(d - D) % 2 != 0 || abs(e - E) % 2 != 0)
    printf("-1");
  else
    printf("%d", ans / 4);
  return 0;
}
