#include <bits/stdc++.h>
int main() {
  int a_num[4];
  int b_num[4];
  while (true) {
    for (int i = 0; i < 4; ++i) {
      if (!(std::cin >> a_num[i])) {
        return 0;
      }
    }
    for (int i = 0; i < 4; ++i) {
      if (!(std::cin >> b_num[i])) {
        return 0;
      }
    }
    int hit = 0;
    for (int i = 0; i < 4; ++i) {
      if (a_num[i] == b_num[i]) {
        ++hit;
      }
    }
    std::cout << hit << " ";
    int blow = 0;
    for (int i = 0; i < 4; ++i) {
      for (int j = 0; j < 4; ++j) {
        if (i == j) {
          break;
        }
        if (b_num[i] == a_num[j]) {
          ++blow;
          break;
        }
      }
    }
    std::cout << blow << std::endl;
  }
  return 0;
}
