#include <bits/stdc++.h>
using namespace std;
map<int, int> m1;
map<int, int> m2;
vector<int> v1;
vector<int> v2;
int main() {
  int n;
  scanf("%d", &n);
  int x;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    v1.push_back(x);
    m1[x]++;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    v2.push_back(x);
    m2[x]++;
  }
  int ans = 0;
  for (int i = 1; i <= 5; i++) {
    int val = m1[i] + m2[i];
    if (val % 2 != 0) {
      printf("-1\n");
      return 0;
    } else
      ans += abs(val / 2 - m1[i]);
  }
  printf("%d\n", ans / 2);
  return 0;
}
