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