#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, k = 0, q, p = 0;
  cin >> n;
  int a[6] = {0, 0, 0, 0, 0, 0};
  int b[6] = {0, 0, 0, 0, 0, 0};
  for (int i = 0; i < n; i++) {
    cin >> d;
    a[d]++;
  }
  for (int i = 0; i < n; i++) {
    cin >> d;
    b[d]++;
  }
  for (int i = 1; i <= 5; i++) {
    q = ((a[i] + b[i]));
    if (q % 2 == 0 && q > 0) {
      p = 1;
      k += (q / 2) - min(a[i], b[i]);
    }
    if (q % 2 != 0 && q > 0) {
      p = 0;
      break;
    }
  }
  if (p != 0) {
    cout << k / 2;
  } else {
    cout << "-1";
  }
  return 0;
}
