#include <bits/stdc++.h>
const double PI = acos(-1);
const double EPS = 1e-10;
using namespace std;
int main() {
  int a[4];
  int b[4];
  while (cin >> a[0]) {
    for (int i = 0; i < 3; i++) cin >> a[i + 1];
    for (int i = 0; i < 4; i++) cin >> b[i];
    int h = 0, br = 0;
    for (int i = 0; i < 4; i++)
      for (int j = i; j < 4; j++)
        if (a[i] == b[j]) {
          if (i == j)
            h++;
          else
            br++;
        }
    cout << h << " " << br << endl;
  }
}
