#include <bits/stdc++.h>
int N;
int num[2][5];
void solve() {
  int sum = 0;
  for (int i = 0; i < 5; i++) {
    int n = num[0][i] + num[1][i];
    if (n % 2 == 1) {
      printf("-1");
      return;
    }
    sum += abs(num[0][i] - num[1][i]);
  }
  sum /= 4;
  printf("%d\n", sum);
  return;
}
int main() {
  int p;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &p);
    num[0][p - 1]++;
  }
  for (int i = 0; i < N; i++) {
    scanf("%d", &p);
    num[1][p - 1]++;
  }
  solve();
  return 0;
}
