#include <bits/stdc++.h>
int n, a[1000005], b[1000005];
int sum[10], cnt[10];
int main() {
  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++) {
    sum[a[i]]++;
    sum[b[i]]++;
    cnt[a[i]]++;
  }
  for (int i = 1; i <= 5; i++) {
    if (sum[i] & 1) {
      printf("-1");
      return 0;
    }
    sum[i] /= 2;
  }
  for (int i = 1; i <= 5; i++) {
    cnt[0] += abs(sum[i] - cnt[i]);
  }
  printf("%d", cnt[0] / 2);
  return 0;
}
