#include <bits/stdc++.h>
using namespace std;
int a[7], b[7];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, x;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    a[x]++;
  }
  for (int i = 1; i <= n; i++) {
    cin >> x;
    b[x]++;
  }
  int ans = 0, cur = 0, cur1 = 0;
  for (int i = 1; i <= 5; i++) {
    if ((a[i] + b[i]) % 2 != 0) {
      cout << "-1\n";
      return 0;
    }
    int temp = (a[i] + b[i]) / 2;
    if (a[i] > b[i]) {
      int req = a[i] - temp;
      if (cur >= req) {
        ans += req;
        cur -= req;
      } else {
        ans += cur;
        cur1 += (req - cur);
        cur = 0;
      }
    } else if (a[i] < b[i]) {
      int req = b[i] - temp;
      if (cur1 >= req) {
        ans += req;
        cur1 -= req;
      } else {
        ans += cur1;
        cur += (req - cur1);
        cur1 = 0;
      }
    }
  }
  cout << ans << "\n";
}
