#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int a[4];
  int b[4];
  int h, br;
  while (h != '\0') {
    h = 0;
    br = 0;
    for (int i = 0; i < 4; i++) cin >> a[i];
    for (int j = 0; j < 4; j++) cin >> b[j];
    for (int k = 0; k < 4; k++) {
      for (int l = 0; l < 4; l++) {
        if (a[k] == b[l]) {
          if (k == l)
            h++;
          else
            br++;
        }
      }
    }
    cout << h << ' ' << br << endl;
  }
}
