#include <bits/stdc++.h>
int main() {
  std::array<u_int, 4> a, b;
  while (std::cin >> a[0] >> a[1] >> a[2] >> a[3] &&
         std::cin >> b[0] >> b[1] >> b[2] >> b[3]) {
    int hit = 0;
    int blow = 0;
    for (int i = 0; i < 4; ++i) {
      if (a[i] == b[i]) hit++;
      if (a[i] == b[(i + 1) % 4] || a[i] == b[(i + 2) % 4] ||
          a[i] == b[(i + 3) % 4])
        blow++;
    }
    std::cout << hit << " " << blow << std::endl;
  }
  return 0;
}
