#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, i, j, k, n, m, ans = 0, sum = 0;
  t = 1;
  while (t--) {
    cin >> n;
    long long a[n], b[n], coun[6] = {0}, couna[6] = {0}, counb[6] = {0};
    for (i = 0; i < n; i++) {
      cin >> a[i];
      coun[a[i]]++;
      couna[a[i]]++;
    }
    for (i = 0; i < n; i++) {
      cin >> b[i];
      coun[b[i]]++;
      counb[b[i]]++;
    }
    for (i = 1; i < 6; i++) {
      if (coun[i] % 2 == 1) {
        printf("-1\n");
        return 0;
      }
    }
    for (i = 1; i < 6; i++) {
      sum = sum + abs(coun[i] / 2 - couna[i]);
    }
    cout << sum / 2;
  }
  return 0;
}
