#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[4];
  while (cin >> a[0] >> a[1] >> a[2] >> a[3]) {
    bool blowlist[10];
    for (auto& i : blowlist) i = false;
    int b[4];
    for (auto& i : a) {
      cin >> i;
      blowlist[i] = true;
    }
    for (auto& i : b) cin >> i;
    int hit = 0;
    int blow = 0;
    for (int i = 0; i < 4; i++) {
      if (a[i] == b[i])
        hit++;
      else if (blowlist[b[i]])
        blow++;
    }
    cout << hit << ' ' << blow << endl;
  }
  return 0;
}
