#include <bits/stdc++.h>
using namespace std;
int main() {
  int A[5];
  int B[5];
  int hit = 0, blow = 0;
  cin >> A[0];
  for (int i = 1; i < 4; i++) {
    cin >> A[i];
  }
  for (int i = 0; i < 4; i++) {
    cin >> B[i];
  }
  for (int i = 0; i < 4; i++) {
    if (A[i] == B[i]) {
      hit++;
    }
    for (int j = 0; j < 4; j++) {
      if (A[i] == B[j] && A[i] != B[i]) {
        blow++;
      }
    }
  }
  cout << hit << " " << blow << endl;
  return 0;
}
