#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  int arr[a];
  int arr2[a];
  int one = 0, two = 0, three = 0, four = 0, five = 0;
  int one1 = 0, two1 = 0, three1 = 0, four1 = 0, five1 = 0;
  for (int i = 0; i < a; i++) {
    cin >> arr[i];
    if (arr[i] == 1) {
      one++;
    } else if (arr[i] == 2) {
      two++;
    } else if (arr[i] == 3) {
      three++;
    } else if (arr[i] == 4) {
      four++;
    } else if (arr[i] == 5) {
      five++;
    }
  }
  for (int i = 0; i < a; i++) {
    cin >> arr2[i];
    if (arr2[i] == 1) {
      one1++;
    } else if (arr2[i] == 2) {
      two1++;
    } else if (arr2[i] == 3) {
      three1++;
    } else if (arr2[i] == 4) {
      four1++;
    } else if (arr2[i] == 5) {
      five1++;
    }
  }
  if (abs(one - one1) % 2 == 1) {
    cout << -1;
  } else if (abs(two - two1) % 2 == 1) {
    cout << -1;
  } else if (abs(three - three1) % 2 == 1) {
    cout << -1;
  } else if (abs(four - four1) % 2 == 1) {
    cout << -1;
  } else if (abs(five - five1) % 2 == 1) {
    cout << -1;
  } else {
    cout << (abs(one - one1) / 2 + abs(two - two1) / 2 +
             abs(three - three1) / 2 + abs(four - four1) / 2 +
             abs(five - five1) / 2) /
                2;
  }
}
