#include <bits/stdc++.h>
using namespace std;
int a[102], b[102], cnt[102], ca[102], cb[102];
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  for (int i = 1; i <= n; i++) {
    cnt[a[i]]++;
    cnt[b[i]]++;
    ca[a[i]]++;
    cb[b[i]]++;
  }
  for (int i = 1; i <= 100; i++) {
    if (cnt[i] % 2) {
      printf("-1");
      return;
    }
    cnt[i] /= 2;
  }
  int ans = 0;
  for (int i = 1; i <= 5; i++) {
    ans += abs(cnt[i] - ca[i]);
  }
  printf("%d", ans / 2);
}
int main() {
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
