#include <bits/stdc++.h>
int n, i, t, f;
int a[2][6];
int main() {
  f = 0;
  memset(a, 0, sizeof(a));
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &t);
    a[1][t]++;
    a[0][t]++;
  }
  for (i = 0; i < n; i++) {
    scanf("%d", &t);
    a[0][t]++;
  }
  for (i = 1; i <= 5; i++) {
    if (a[0][i] & 1) {
      f = -1;
      break;
    }
    a[0][i] >>= 1;
    if (a[0][i] < a[1][i]) f += (a[1][i] - a[0][i]);
  }
  printf("%d\n", f);
  return 0;
}
