#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int a[maxn], b[maxn];
int a1[6], b1[6], N;
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) {
    scanf("%d", &a[i]);
    a1[a[i]]++;
  }
  for (int i = 1; i <= N; ++i) {
    scanf("%d", &b[i]);
    b1[b[i]]++;
  }
  for (int i = 1; i <= 5; ++i) {
    if ((a1[i] + b1[i]) % 2) {
      cout << -1 << endl;
      return 0;
    } else
      continue;
  }
  int ans = 0;
  for (int i = 1; i <= 5; ++i) {
    int temp = (a1[i] + b1[i]) / 2;
    ans += abs(temp - a1[i]);
  }
  cout << ans / 2 << endl;
  return 0;
}
