#include <bits/stdc++.h>
using namespace std;
int gs[6], gs1[6], gs2[6];
int main() {
  ios_base::sync_with_stdio(false);
  int n, i, j;
  cin >> n;
  int a[n + 1], b[n + 1];
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    gs[a[i]]++;
    gs1[a[i]]++;
  }
  for (i = 1; i <= n; i++) {
    cin >> b[i];
    gs[b[i]]++;
    gs2[b[i]]++;
  }
  for (i = 1; i < 6; i++) {
    if (gs[i] % 2) {
      cout << "-1" << endl;
      return 0;
    }
  }
  int num = 0;
  for (i = 1; i < 6; i++) {
    num += abs(gs1[i] - gs2[i]) / 2;
  }
  cout << num / 2 << endl;
  return 0;
}
