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