#include <bits/stdc++.h>
using namespace std;
int main() {
  int tmp = 0;
  while (1) {
    if (tmp > 50) break;
    vector<int> a(4);
    vector<int> b(4);
    for (int i = 0; i < 4; i++) cin >> a[i];
    for (int i = 0; i < 4; i++) cin >> b[i];
    int hit = 0, blow = 0;
    for (int i = 0; i < 4; i++) {
      if (a[i] == b[i])
        hit++;
      else {
        for (int j = 0; j < 4; j++)
          if (a[j] == b[i]) blow++;
      }
    }
    cout << hit << " " << blow << endl;
    tmp++;
  }
  return 0;
}
