#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[6] = {0}, b[6] = {0}, diff[6] = {0};
  int d;
  cin >> n;
  int ans = 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) diff[i] = a[i] - b[i];
  for (int i = 1; i <= 5; ++i) {
    if ((a[i] + b[i]) % 2 == 0)
      ans += abs(diff[i]);
    else {
      cout << -1;
      return 0;
    }
  }
  cout << ans / 4;
  return 0;
}
