#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[4], b[4];
  while (cin >> a[0] >> a[1] >> a[2] >> a[3], !cin.eof()) {
    int Hit = 0, Blow = 0;
    bool hantei[4];
    cin >> b[0] >> b[1] >> b[2] >> b[3];
    if (cin.eof()) {
      break;
    }
    for (int i = 0; i < 4; i++) {
      if (a[i] == b[i]) {
        Hit++;
        hantei[i] = true;
      }
    }
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < 4; j++) {
        if (i != j && !(hantei[i]) && b[i] == a[j]) {
          Blow++;
          break;
        }
      }
    }
    cout << Hit << ' ' << Blow << endl;
  }
  return 0;
}
