#include <bits/stdc++.h>
int main() {
  int a, b[105] = {0}, c[105] = {0}, bb[6] = {0}, i, cc[6] = {0}, ans = 0,
         flag = 0;
  scanf("%d", &a);
  for (i = 1; i <= a; i++) {
    scanf("%d", &b[i]);
    bb[b[i]]++;
  }
  for (i = 1; i <= a; i++) {
    scanf("%d", &c[i]);
    cc[c[i]]++;
  }
  for (i = 1; i <= 5; i++) {
    if ((cc[i] + bb[i]) % 2 == 1) {
      printf("-1");
      return 0;
    }
    if (cc[i] > bb[i]) {
      ans = (cc[i] - bb[i]) / 2 + ans;
      flag++;
      continue;
    }
    if (bb[i] > cc[i]) {
      ans = (bb[i] - cc[i]) / 2 + ans;
      flag++;
      continue;
    }
  }
  printf("%d", ans / 2);
  return 0;
}
