#include <bits/stdc++.h>
using namespace std;
int main() {
  array<int, 4> a;
  array<int, 4> b;
  int hit = 0, brow = 0;
  while (cin >> a.at(0)) {
    int hit = 0, brow = 0;
    for (int i = 1; i < 4; i++) {
      cin >> a.at(i);
    }
    for (int j = 0; j < 4; j++) {
      cin >> b.at(j);
    }
    for (int k = 0; k < 4; k++) {
      for (int l = 0; l < 4; l++) {
        if (a.at(k) == b.at(l)) {
          if (k == l) {
            hit++;
          } else {
            brow++;
          }
        }
      }
    }
    cout << hit << " " << brow << endl;
  }
  return 0;
}
