#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int aa[4], bb[4];
  int ht, bl;
  while (1) {
    for (int i = 0; i < 4; i++) cin >> aa[i];
    for (int i = 0; i < 4; i++) cin >> bb[i];
    ht = 0;
    bl = 0;
    for (int i = 0; i < 4; i++)
      for (int j = 0; j < 4; j++) {
        if (aa[i] == bb[j]) {
          if (i == j)
            ht++;
          else
            bl++;
        }
      }
    cout << ht << " " << bl << endl;
  }
  return 0;
}
