#include <bits/stdc++.h>
using namespace std;
int main() {
  int h = 0, v = 0;
  int a[5], b[5];
  cin >> a[0] >> a[1] >> a[2] >> a[3];
  while (cin >> b[0] >> b[1] >> b[2] >> b[3]) {
    for (long long int i = 0; i < (4); i++) {
      for (long long int j = 0; j < (4); j++) {
        if (b[i] == a[j]) {
          v++;
          if (i == j) {
            v--;
            h++;
          }
        }
      }
    }
    cout << h << " " << v << endl;
    h = v = 0;
  }
}
