#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(6, 0), 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 x = 0;
  bool check = true;
  for (int i = 0; i < 6; i++) {
    if ((a[i] + b[i]) % 2 != 0) {
      check = false;
      break;
    }
    x += abs((a[i] + b[i]) / 2 - a[i]);
  }
  if (!check)
    cout << -1;
  else
    cout << x / 2;
  return 0;
}
