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