#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[5] = {}, b[5] = {};
  for (int k = 0; k < n; k++) {
    int x;
    cin >> x;
    a[x - 1]++;
  }
  for (int k = 0; k < n; k++) {
    int x;
    cin >> x;
    b[x - 1]++;
  }
  int cnt = 0;
  for (int k = 0; k < 5; k++) {
    if ((a[k] + b[k]) % 2 != 0) {
      cout << -1;
      return 0;
    }
    cnt += (max(a[k], b[k]) - min(a[k], b[k])) / 2;
  }
  cout << (cnt % 2 == 0 ? cnt / 2 : -1);
  return 0;
}
