#include <bits/stdc++.h>
using namespace std;
int n, u[6], v[6], x;
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); i++) {
    scanf("%d", &x);
    u[x]++;
  }
  for (int i = (1); i <= (n); i++) {
    scanf("%d", &x);
    v[x]++;
  }
  int dif = 0;
  for (int i = (1); i <= (5); i++)
    if ((u[i] + v[i]) & 1) {
      printf("-1\n");
      return 0;
    } else
      dif += max(0, (u[i] - v[i]) / 2);
  printf("%d\n", dif);
  return 0;
}
