#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], b[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  int tot[6] = {0};
  int count[6] = {0};
  for (int i = 0; i < n; i++) {
    tot[a[i]]++;
    tot[b[i]]++;
    count[a[i]]++;
  }
  for (int i = 1; i <= 5; i++) {
    if (tot[i] % 2 != 0) {
      cout << -1;
      return 0;
    }
  }
  int ans = 0;
  for (int i = 1; i <= 5; i++) {
    ans += abs(count[i] - (tot[i] / 2));
  }
  cout << ans / 2 << endl;
  return 0;
}
