#include<iostream>
#include<algorithm>
using namespace std;

int main() {
  int a[4], b[4];

  while (cin >> a[0]) {
    for (int i = 1; i < 4; i++) cin >> a[i];
    for (int i = 0; i < 4; i++) cin >> b[i];

    int hit = 0;
    for (int i = 0; i < 4; i++)
      if (a[i] == b[i])
        hit++;

    int blow = 0;
    bool aa[10], bb[10];
    for (int i = 0; i < 10; i++)
      aa[i] = bb[i] = false;

    for (int i = 0; i < 4; i++) {
      aa[a[i]] = true;
      bb[b[i]] = true;
    }

    for (int i = 0; i < 10; i++)
      if (aa[i] and bb[i])
        blow++;

    cout << hit << " " << blow - hit << endl;
  }
}