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