#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  cin >> n;
  int a[6] = {0}, b[6] = {0}, cnt[6] = {0};
  for (int i = 0; i <= n - 1; i++) {
    cin >> x;
    cnt[x]++;
    a[x]++;
  }
  for (int i = 0; i <= n - 1; i++) {
    cin >> x;
    cnt[x]++;
    b[x]++;
  }
  int ans = 0, f = 0;
  for (int i = 1; i <= 5; i++) {
    if (cnt[i] & 1) {
      f = 1;
      break;
    } else {
      if (a[i] > (cnt[i] / 2)) {
        ans += (a[i] - (cnt[i] / 2));
      }
    }
  }
  if (f)
    cout << -1 << endl;
  else
    cout << ans << endl;
  return 0;
}
