#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000009;
const int Max = 1000007;
const double PI = acos(-1.0);
int trck[6];
int main() {
  int i, j, k, l, temp, t, n, m, caseno = 0, ans;
  string str;
  while (cin >> n) {
    memset(trck, 0, sizeof(trck));
    for (i = 0; i < n; i++) {
      cin >> k;
      trck[k]++;
    }
    for (i = 0; i < n; i++) {
      cin >> k;
      trck[k]--;
    }
    ans = 0;
    for (i = 1; i <= 5; i++) {
      if (trck[i] & 1) {
        ans = -1;
        break;
      }
      ans += abs(trck[i]) >> 1;
    }
    if (ans > 0) ans /= 2;
    cout << ans << endl;
  }
  return 0;
}
