#include <bits/stdc++.h>
using namespace std;
int a1[105];
int a2[105];
int vis1[10];
int vis2[10];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a1[i]);
    vis1[a1[i]]++;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &a2[i]);
    vis2[a2[i]]++;
  }
  int ans = 0;
  int ans2 = 0;
  int h1 = 0;
  int flag = 0;
  for (int i = 0; i < 6; i++) {
    if (vis1[i] != vis2[i]) {
      ans += vis1[i] - vis2[i];
      if (vis1[i] > vis2[i]) ans2 += vis1[i] - vis2[i];
      if (ans2 % 2 != 0 || ans % 2 != 0) flag = 1;
    }
  }
  if (flag == 1 || ans != 0 || ans2 % 2 != 0)
    printf("-1\n");
  else {
    printf("%d\n", ans2 / 2);
  }
  return 0;
}
