#include <bits/stdc++.h>
using namespace std;
int a[6];
int b[6];
int main() {
  int n;
  int t;
  int ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &t);
    a[t]++;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &t);
    b[t]++;
  }
  for (int i = 1; i <= 5; i++) {
    if ((a[i] + b[i]) % 2) {
      cout << "-1" << endl;
      return 0;
    }
  }
  for (int i = 1; i <= 5; i++) {
    if (b[i] > a[i]) ans += (b[i] - a[i]);
  }
  if (ans % 2)
    cout << "-1" << endl;
  else
    cout << ans / 2 << endl;
  return 0;
}
