#include <bits/stdc++.h>
using namespace std;
int n, a[6], b[6];
signed main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int tt;
    scanf("%d", &tt);
    a[tt]++;
  }
  for (int tt, i = 1; i <= n; ++i) {
    scanf("%d", &tt);
    b[tt]++;
  }
  int flag = true;
  for (int i = 1; i <= 5; ++i) {
    if (abs(a[i] - b[i]) % 2 == 1) flag = false;
  }
  if (flag == false) {
    puts("-1");
  } else {
    int res = 0;
    for (int i = 1; i <= 5; ++i) {
      res += abs(a[i] - b[i]) / 2;
    }
    cout << res / 2 << endl;
  }
  return 0;
}
