#include <bits/stdc++.h>
using namespace std;
int const maxn = (int)2e6 + 1, inf = (int)2e9 + 1;
long long mod = 1e9 + 7, ans;
map<char, int> pidr;
long long k, n, cur, a[maxn], b[maxn], a1[maxn], b1[maxn], pos, spos, x;
long long sz;
vector<pair<int, pair<int, int> > > v;
bool used[maxn];
string t;
int main() {
  string second;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a1[a[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
    b1[b[i]]++;
  }
  for (int i = 1; i <= 5; i++) {
    if (a1[i] != b1[i]) {
      if (abs(a1[i] - b1[i]) % 2 == 1) {
        cout << -1;
        return 0;
      } else {
        if (a1[i] > b1[i])
          x += abs(a1[i] - b1[i]) / 2;
        else
          x -= (abs(a1[i] - b1[i])) / 2;
        ans += abs(a1[i] - b1[i]) / 2;
      }
    }
  }
  if (x == 0)
    cout << ans / 2;
  else
    cout << -1;
  return 0;
}
