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