#include <bits/stdc++.h>
using namespace std;
int arr[6], arr1[6], arr2[6];
int main() {
  int n, sum = 0;
  cin >> n;
  vector<int> v(n), v1(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    arr[v[i]]++;
    arr1[v[i]]++;
  }
  for (int i = 0; i < n; i++) {
    cin >> v1[i];
    arr[v1[i]]++;
    arr2[v1[i]]++;
  }
  for (int i = 1; i <= 5; i++) {
    if (arr[i] % 2 == 1) {
      cout << -1 << endl;
      return 0;
    }
    arr[i] = arr[i] / 2;
  }
  for (int i = 1; i <= 5; i++) {
    if (arr1[i] > arr[i]) sum += (arr1[i] - arr[i]);
    if (arr2[i] > arr[i]) sum += (arr2[i] - arr[i]);
  }
  cout << sum / 2 << endl;
}
