#include <bits/stdc++.h>
using namespace std;
const int SIZE = 100009;
const int OO = (int)1e9;
int n, k;
int arr[300000], a[300000], arr1[30000], b[30000];
int vis[300000];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", arr + i);
    a[arr[i]]++;
  }
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", arr1 + i);
    b[arr1[i]]++;
  }
  int p = 0, x = 0;
  int ans = 0;
  for (int i = 1; i < 6; i++) {
    if (a[i] > 0 || b[i] > 0) {
      if (a[i] > b[i]) {
        if ((a[i] - b[i]) % 2 == 0) {
          ans += (a[i] - b[i]) / 2;
          p += (a[i] - b[i]) / 2;
        } else {
          ans = -1;
          break;
        }
      } else if (b[i] > a[i]) {
        if ((b[i] - a[i]) % 2 == 0) {
          ans += (b[i] - a[i]) / 2;
          x += (b[i] - a[i]) / 2;
        } else {
          ans = -1;
          break;
        }
      }
    }
  }
  if (ans == -1 || p != x) return puts("-1");
  printf("%d", ans / 2);
}
