#include <bits/stdc++.h>
using namespace std;
int a[110], b[110];
int num[10];
int numa[10], numb[10];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    num[a[i]]++;
    numa[a[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
    num[b[i]]++;
    numb[b[i]]++;
  }
  bool flag = 1;
  for (int i = 1; i <= 5; i++)
    if (num[i] % 2) flag = 0;
  if (flag) {
    int ans = 0;
    for (int i = 1; i <= 5; i++) ans += abs(numa[i] - numb[i]);
    cout << ans / 4;
  } else
    cout << "-1" << endl;
  return 0;
}
