#include <bits/stdc++.h>
using namespace std;
const int oo = 168430090;
int rd() {
  int z = 0, mk = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') mk = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    z = (z << 3) + (z << 1) + ch - '0';
    ch = getchar();
  }
  return z * mk;
}
int n;
int a[110], b[110];
int cnt[2][6];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) a[i] = rd(), ++cnt[0][a[i]];
  for (int i = 1; i <= n; ++i) b[i] = rd(), ++cnt[1][b[i]];
  int ans = 0;
  for (int i = 1; i <= 5; ++i) {
    if (abs(cnt[0][i] - cnt[1][i]) & 1) {
      ans = -1;
      break;
    } else
      ans += abs(cnt[0][i] - cnt[1][i]) >> 1;
  }
  cout << (ans >> 1) << endl;
  return 0;
}
