#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[5], b[5], hit = 0, brow = 0;
  while (scanf("%d", &a[0]) != EOF) {
    for (int i = 1; i < 4; i++) {
      cin >> a[i];
    }
    for (int i = 0; i < 4; i++) {
      cin >> b[i];
    }
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < 4; j++) {
        if (a[i] == b[i]) {
          hit++;
          break;
        } else if (a[i] == b[j])
          brow++;
      }
    }
    cout << hit << " " << brow << endl;
  }
  return 0;
}
