#include <bits/stdc++.h>
using namespace std;
int const MOD = 1000000007;
int main() {
  set<int> s1, s2;
  int a[4], b[4];
  while (cin >> a[0] >> a[1] >> a[2] >> a[3] >> b[0] >> b[1] >> b[2] >> b[3]) {
    for (int i = 0; i < 4; i++) s1.insert(a[i]);
    for (int i = 0; i < 4; 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;
}
