#include <bits/stdc++.h>
using namespace std;
int main() {
  while (cin) {
    int input, hit = 0;
    vector<int> a, b, c, d;
    for (int i = 0; i < 8; ++i) {
      cin >> input;
      a.push_back(input);
    }
    for (int i = 0; i < 4; ++i) {
      if (a[i] == a[i + 4]) {
        b.push_back(a[i]);
        hit++;
      }
    }
    set_intersection(a.begin(), a.begin() + 4, a.begin() + 5, a.end() + 8,
                     back_inserter(c));
    set_difference(c.begin(), c.end(), b.begin(), b.end(), back_inserter(d));
    cout << hit << ' ' << d.size() << endl;
  }
  return 0;
}
