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