#include <bits/stdc++.h>
using namespace std;
long long int call(long long int a, long long int b) {
  if (a % b == 0)
    return (a / b);
  else
    return (a / b) + 1;
}
long long int max1(long long int a1, long long int b1) {
  if (a1 >= b1) return a1;
  return b1;
}
long long int sop(string s) {
  long long int sum = 0, i;
  for (i = 0; i < s.length(); i++) sum = sum + (s[i] - '0');
  return sum;
}
int main() {
  long long int t, n, i, j, k, l, flag, flag1, count, count1, count2, count3,
      count4, sum, max1, max2, m, c1, c2, temp, suma, sumb;
  long long int a[300001];
  long long int a1[300001];
  vector<long long int> v1, v2, v;
  vector<string> vs;
  map<long long int, long long int> m1;
  string s1, s2, s;
  long long int f[6], f1[6];
  for (i = 0; i < 6; i++) f[i] = 0;
  for (i = 0; i < 6; i++) f1[i] = 0;
  count = 0, flag = 0, flag1 = 0, sum = 0, max1 = 0, max2 = 0, c1 = 0, c2 = 0,
  temp = 0, suma = 0, sumb = 0, count1 = 0, count2 = 0, count3 = 0, count4 = 0;
  long long int max3 = 0, max4 = 0, min1 = 999999999, ans = 0;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) cin >> a1[i];
  for (i = 0; i < n; i++) f[a[i]]++;
  for (i = 0; i < n; i++) f1[a1[i]]++;
  for (i = 1; i < 6; i++) {
    if (abs(f[i] - f1[i]) % 2 != 0) {
      flag = 1;
      break;
    } else
      sum = sum + abs(f[i] - f1[i]) / 2;
  }
  if (sum % 2 == 1) flag = 1;
  if (flag == 1)
    printf("-1\n");
  else
    cout << sum / 2;
  return 0;
}
