#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans_a[100], ans_b[100];
  int hit = 0, brow = 0;
  cin >> ans_a[0] >> ans_a[1] >> ans_a[2] >> ans_a[3] >> ans_b[0] >> ans_b[1] >>
      ans_b[2] >> ans_b[3];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (ans_a[i] == ans_b[j] && i == j) {
        hit++;
      } else if (ans_a[i] == ans_b[j]) {
        brow++;
      }
    }
  }
  printf("%d %d", hit, brow);
  puts("");
  return 0;
}
