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