#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, n, t, a[6] = {0}, b[6] = {0}, sum = 0, c = 0, flag = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> t;
    a[t]++;
  }
  for (i = 0; i < n; i++) {
    cin >> t;
    b[t]++;
  }
  for (i = 1; i < 6; i++) {
    if ((a[i] + b[i]) % 2 != 0) flag = 1;
    sum += a[i] - b[i];
    if (a[i] - b[i] > 0) c += a[i] - b[i];
  }
  if (sum != 0) flag = 1;
  if (flag == 1)
    cout << -1 << endl;
  else {
    cout << c / 2 << endl;
  }
  return 0;
}
