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