#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> g1, g2;
  int n, i, sum_A = 0, sum_B = 0, count1_A, count1_B, count2_A, count2_B,
            count3_A, count3_B, count4_A, count4_B, count5_A, count5_B, input1;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> input1;
    g1.push_back(input1);
  }
  for (i = 0; i < n; i++) {
    cin >> input1;
    g2.push_back(input1);
  }
  count1_A = count(g1.begin(), g1.end(), 1);
  count1_B = count(g2.begin(), g2.end(), 1);
  count2_A = count(g1.begin(), g1.end(), 2);
  count2_B = count(g2.begin(), g2.end(), 2);
  count3_A = count(g1.begin(), g1.end(), 3);
  count3_B = count(g2.begin(), g2.end(), 3);
  count4_A = count(g1.begin(), g1.end(), 4);
  count4_B = count(g2.begin(), g2.end(), 4);
  count5_A = count(g1.begin(), g1.end(), 5);
  count5_B = count(g2.begin(), g2.end(), 5);
  if (count1_A > count1_B)
    sum_A = sum_A + (count1_A - count1_B);
  else
    sum_B = sum_B + (count1_B - count1_A);
  if (count2_A > count2_B)
    sum_A = sum_A + (count2_A - count2_B);
  else
    sum_B = sum_B + (count2_B - count2_A);
  if (count3_A > count3_B)
    sum_A = sum_A + (count3_A - count3_B);
  else
    sum_B = sum_B + (count3_B - count3_A);
  if (count4_A > count4_B)
    sum_A = sum_A + (count4_A - count4_B);
  else
    sum_B = sum_B + (count4_B - count4_A);
  if (count5_A > count5_B)
    sum_A = sum_A + (count5_A - count5_B);
  else
    sum_B = sum_B + (count5_B - count5_A);
  if (abs(count1_A - count1_B) % 2 != 0 || abs(count2_A - count2_B) % 2 != 0 ||
      abs(count3_A - count3_B) % 2 != 0 || abs(count4_A - count4_B) % 2 != 0 ||
      abs(count5_A - count5_B) % 2 != 0) {
    cout << -1 << endl;
  } else if (sum_A == sum_B && sum_A % 2 == 0 && sum_B % 2 == 0)
    cout << sum_B / 2 << endl;
}
