#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int N, cnt = 0;
  cin >> N;
  int a[6] = {0};
  int b[6] = {0};
  for (int i = 1; i <= N; i++) {
    int x;
    cin >> x;
    a[x]++;
  }
  for (int i = 1; i <= N; i++) {
    int x;
    cin >> x;
    b[x]++;
  }
  bool can = true;
  for (int i = 1; i <= 5; i++) {
    if ((a[i] + b[i]) % 2 != 0) {
      can = false;
    } else {
      cnt += abs(a[i] - (a[i] + b[i]) / 2);
    }
  }
  if (can) {
    cout << cnt / 2;
  } else {
    cout << -1;
  }
  return 0;
}
