#include <bits/stdc++.h>
using namespace std;
int fre[200];
int fre1[200];
int fre3[200];
int main() {
  int n;
  cin >> n;
  int a[200], b[200];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    fre[a[i]]++;
    fre3[a[i]]++;
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    fre1[b[i]]++;
    fre3[b[i]]++;
  }
  int flag = 0;
  for (int i = 1; i <= 5; i++) {
    if (fre3[i] % 2 != 0) {
      printf("-1\n");
      return 0;
    }
  }
  int sum = 0;
  for (int i = 1; i <= 5; i++) {
    if (fre[i] < fre3[i] / 2) {
      sum += fre3[i] / 2 - fre[i];
    }
  }
  cout << sum << "\n";
  return 0;
}
