#include <bits/stdc++.h>
int main() {
  int n, G[5] = {};
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int p;
    scanf("%d", &p);
    G[p - 1]++;
  }
  for (int i = 0; i < n; i++) {
    int p;
    scanf("%d", &p);
    G[p - 1]--;
  }
  int ans = 0;
  for (int i = 0; i < 5; i++) {
    if (G[i] & 1) {
      ans = -1;
      break;
    } else {
      if (G[i] > 0) {
        ans += G[i] >> 1;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
