#include <bits/stdc++.h>
using namespace std;
int const MOD = 1000000007;
int main() {
  set<int> s1, s2;
  int a[4], b[4];
  while (1) {
    for (int i = 0; i < 4; i++) {
      cin >> a[i];
      s1.insert(a[i]);
    }
    for (int i = 0; i < 4; i++) {
      cin >> b[i];
      s2.insert(b[i]);
    }
    int hit = 0, blow = 0;
    for (int i = 0; i < 4; i++) {
      if (a[i] == b[i])
        hit++;
      else if (s1.count(b[i]) != 0)
        blow++;
    }
    printf("%d %d\n", hit, blow);
  }
  return 0;
}
