#include <bits/stdc++.h>
using namespace std;
const int M = 1E9 + 7;
const int NMAX = 7000 + 9;
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  cout.precision(30);
  int n;
  cin >> n;
  int a[6] = {0};
  int b[6] = {0};
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    a[t]++;
  }
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    b[t]++;
  }
  int ans = 0;
  for (int i = 1; i <= 5; i++)
    if ((a[i] + b[i]) % 2 != 0) {
      cout << -1;
      return 0;
    } else {
      ans += abs(a[i] - b[i]);
    }
  cout << ans / 4;
  return 0;
};
