#include <bits/stdc++.h>
using namespace std;
int cnt1[6], cnt2[6], cnt[6], n, ans;
int main() {
  cin >> n;
  for (int i = 1, v; i <= n; i++) cin >> v, cnt1[v]++, cnt[v]++;
  for (int i = 1, v; i <= n; i++) cin >> v, cnt2[v]++, cnt[v]++;
  for (int i = 1; i <= 5; i++)
    if (cnt[i] & 1) return puts("-1"), 0;
  for (int i = 1; i <= 5; i++) ans += abs(cnt1[i] - cnt[i] / 2);
  cout << ans / 2;
  return 0;
}
