#include <bits/stdc++.h>
using namespace std;
const long long m = 1000000007;
long long b[1000001];
bool prima[1000001];
void seive() {
  prima[0] = 1;
  prima[1] = 1;
  for (int i = 2; i * i <= 1000000; i++)
    if (!prima[i]) {
      for (int j = i * i; j <= 1000000; j += i) prima[j] = 1;
    }
}
void shrouk() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
}
int main() {
  shrouk();
  long long c = 0, r = 0;
  long long mn = 10000000, mx = -10000000;
  bool b = false;
  long long a[100000], e[100000];
  vector<char> v, v1, v2;
  pair<long long, long long> p;
  string s;
  long long x, y, n, t;
  long long y1 = 0, y2 = 0, y3 = 0, y4 = 0, y5 = 0;
  long long x1 = 0, x2 = 0, x3 = 0, x4 = 0, x5 = 0;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a[i];
    if (a[i] == 1)
      y1++;
    else if (a[i] == 2)
      y2++;
    else if (a[i] == 3)
      y3++;
    else if (a[i] == 4)
      y4++;
    else if (a[i] == 5)
      y5++;
  }
  for (int i = 0; i < t; i++) {
    cin >> e[i];
    if (e[i] == 1)
      x1++;
    else if (e[i] == 2)
      x2++;
    else if (e[i] == 3)
      x3++;
    else if (e[i] == 4)
      x4++;
    else if (e[i] == 5)
      x5++;
  }
  long long z1 = x1 + y1;
  long long z2 = x2 + y2;
  long long z3 = x3 + y3;
  long long z4 = x4 + y4;
  long long z5 = x5 + y5;
  if (z1 % 2 != 0 || z2 % 2 != 0 || z3 % 2 != 0 || z4 % 2 != 0 || z5 % 2 != 0) {
    cout << "-1" << endl;
    return 0;
  }
  long long m;
  z1 /= 2;
  m = max(x1, y1) - z1;
  c += m;
  z2 /= 2;
  m = max(x2, y2) - z2;
  c += m;
  z3 /= 2;
  m = max(x3, y3) - z3;
  c += m;
  z4 /= 2;
  m = max(x4, y4) - z4;
  c += m;
  z5 /= 2;
  m = max(x5, y5) - z5;
  c += m;
  cout << c / 2 << endl;
}
