#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j;
  int hit, blow;
  int numa[4];
  int numb[4];
  while (1) {
    if (cin.eof()) {
      break;
    }
    for (i = 0; i < 4; i++) {
      cin >> numa[i];
    }
    for (i = 0; i < 4; i++) {
      cin >> numb[i];
    }
    hit = 0;
    for (i = 0; i < 4; i++) {
      if (numa[i] == numb[i]) {
        hit = hit + 1;
      }
    }
    blow = 0;
    for (i = 0; i < 4; i++) {
      for (j = 0; j < 4; j++) {
        if (numa[i] == numb[j] && i != j) {
          blow = blow + 1;
        }
      }
    }
    cout << hit << " " << blow << endl;
  }
  cout << hit << " " << blow << endl;
  return 0;
}
