#include <bits/stdc++.h>
using namespace std;
int f1[6], f2[6];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    f1[x]++;
  }
  for (int j = 0; j < n; j++) {
    int x;
    cin >> x;
    f2[x]++;
  }
  int ans = 0;
  for (int i = 1; i < 6; i++) {
    if ((f1[i] + f2[i]) != 0 && (f1[i] + f2[i]) % 2 != 0) {
      cout << -1 << endl;
      return 0;
    }
    if (f1[i] > f2[i]) ans += (f1[i] - f2[i]) / 2;
  }
  cout << ans << endl;
  return 0;
}
