#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, i, j, k, l, m, hit, blow;
  vector<int> s, t, u;
  while (true) {
    hit = 0;
    blow = 0;
    s.clear();
    t.clear();
    for (i = 0; i < 4; i++) {
      cin >> a;
      s.push_back(a);
    }
    for (j = 0; j < 4; j++) {
      cin >> a;
      t.push_back(a);
    }
    for (k = 0; k < 4; k++) {
      if (s[k] == t[k] && s[k] >= 0) {
        hit += 1;
        s[k] = -1;
        t[k] = -1;
      }
    }
    for (l = 0; l < 4; l++) {
      for (m = 0; m < 4; m++) {
        if (s[l] == t[m] && s[l] > 0) {
          blow += 1;
          s[l] = -1;
          t[m] = -1;
        }
      }
    }
    cout << hit << " " << blow << endl;
  }
  return 0;
}
