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