#include <bits/stdc++.h>
using namespace std;
int arr[5 + 1];
int main() {
  int n, ans = 0, tmp;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    arr[tmp]++;
  }
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    arr[tmp]--;
  }
  for (int i = 1; i < 6; i++) {
    if (arr[i] % 2 != 0) {
      cout << "-1";
      return 0;
    }
    ans += abs(arr[i]) / 2;
  }
  if (ans % 2 != 0)
    cout << ans / 2 + 1;
  else
    cout << ans / 2;
  return 0;
}
