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