#include <bits/stdc++.h>
using namespace std;
int freq[3][5];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    a--;
    freq[0][a]++;
    freq[2][a]++;
  }
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    a--;
    freq[1][a]++;
    freq[2][a]++;
  }
  for (int i = 0; i < 5; i++)
    if (freq[2][i] & 1) return puts("-1");
  int ans = 0;
  for (int i = 0; i < 5; i++) ans += abs(freq[0][i] - freq[1][i]) / 2;
  cout << ans / 2 << endl;
}
