#include <bits/stdc++.h>
using namespace std;
int main() {
  while (true) {
    vector<int> a, b;
    for (int i = 0; i < 4; i++) {
      int tmp;
      cin >> tmp;
      a.push_back(tmp);
    }
    for (int i = 0; i < 4; i++) {
      int tmp;
      cin >> tmp;
      b.push_back(tmp);
    }
    int hit = 0;
    int blow = 0;
    for (int i = 0; i < a.size(); i++) {
      for (int j = 0; j < b.size(); j++) {
        if (a[i] == b[j]) {
          if (i == j) {
            hit++;
          } else {
            blow++;
          }
        }
      }
    }
    cout << hit << " " << blow << endl;
  }
}
