#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  while (1) {
    vector<int> a(4, 0), b(4, 0);
    int hit = 0, blow = 0;
    for (int i = 0; i < 4; i++) {
      cin >> a[i];
    }
    for (int i = 0; i < 4; i++) {
      cin >> b[i];
    }
    for (int i = 0; i < 4; i++) {
      if (a[i] == b[i]) {
        hit += 1;
      }
    }
    for (int i = 0; i < 4; i++) {
      blow += count(b.begin(), b.end(), a[i]);
    }
    printf("%d %d\n", hit, blow - hit);
  }
  return 0;
}
