#include <bits/stdc++.h>
using namespace std;
int a[6], b[6];
int main() {
  int n;
  while (cin >> n) {
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    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]++;
    }
    bool k = false;
    for (int i = 1; i < 6; i++) {
      if ((a[i] + b[i]) % 2 != 0) {
        k = true;
        break;
      }
    }
    if (k)
      printf("-1\n");
    else {
      int ans = 0;
      for (int i = 1; i < 6; i++) {
        ans += (abs(a[i] - b[i])) / 2;
      }
      printf("%d\n", ans / 2);
    }
  }
  return 0;
}
