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