#include <bits/stdc++.h>
using namespace std;
int main() {
  int h = 0, n = 0;
  while (1) {
    int a[3], b[3], dat = 1;
    for (int i = 0; i < 4; i++) {
      cin >> dat;
      a[i] = dat;
    }
    for (int j = 0; j < 4; j++) {
      cin >> dat;
      b[j] = dat;
    }
    if (dat == EOF) {
      break;
    }
    for (int k = 0; k < 4; k++) {
      for (int o = 0; o < 4; o++) {
        if (a[k] == b[k]) {
          h++;
        }
        if (a[k] != b[k] && a[k] == b[o]) {
          n++;
        }
      }
    }
  }
  cout << h << endl;
  cout << n << endl;
  return 0;
}
