#include <bits/stdc++.h>
using namespace std;
int main() {
  for (int i = 0; i < 2; i++) {
    int tmp, x = 0, y = 0, d[4];
    for (int j = 0; j < 4; j++) cin >> d[j];
    for (int j = 0; j < 4; j++) {
      cin >> tmp;
      if (d[j] == tmp) {
        x++;
        continue;
      }
      for (int k = 0; k < 4; k++)
        if (d[k] == tmp) {
          y++;
          break;
        }
    }
    cout << x << ' ' << y << endl;
  }
}
