#include <bits/stdc++.h>
void counter(int* n_a, int* n_b, int* hit, int* blow);
int main() {
  std::array<int, 4> n_a;
  std::array<int, 4> n_b;
  while (std::cin) {
    std::cin >> n_a[0] >> n_a[1] >> n_a[2] >> n_a[3];
    std::cin >> n_b[0] >> n_b[1] >> n_b[2] >> n_b[3];
    int hit = 0;
    int blow = 0;
    counter(n_a.data(), n_b.data(), &hit, &blow);
    std::cout << hit << " " << blow << std::endl;
  }
}
void counter(int* n_a, int* n_b, int* hit, int* blow) {
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      if (n_a[i] == n_b[j] && i == j) {
        *hit = *hit + 1;
      } else if (n_a[i] == n_b[j]) {
        *blow = *blow + 1;
      } else {
      }
    }
  }
}
