#include <bits/stdc++.h>
using namespace std;
int tong[120], ans;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    tong[x]++;
  }
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    tong[x]--;
  }
  for (int i = 1; i <= 5; i++) {
    if (abs(tong[i]) % 2 == 1) {
      cout << "-1";
      return 0;
    }
    ans += abs(tong[i]);
  }
  cout << ans / 4;
  return 0;
}
