#include <bits/stdc++.h>
using namespace std;
int n, b, i, v[105], v2[105], a[7], a2[7], s;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> v[i];
    a[v[i]]++;
  }
  for (i = 1; i <= n; i++) {
    cin >> v2[i];
    a2[v2[i]]++;
  }
  int k = 0;
  for (i = 1; i <= 5; i++)
    if ((a[i] + a2[i]) % 2 != 0) k = 1;
  if (k == 1)
    cout << "-1";
  else {
    for (i = 1; i <= 5; i++) s = s + abs(a[i] - a2[i]);
    cout << s / 4;
  }
  return 0;
}
