#include <bits/stdc++.h>
using namespace std;
const int iINF = 2147483647;
const long long lINF = 9223372036854775807;
template <class T>
inline void dbg(T t) {
  cout << t << endl;
}
int main() {
  vector<int> a(4), b(4);
  bool use[10] = {0};
  while (scanf("%d %d %d %d %d %d %d %d", &a[0], &a[1], &a[2], &a[3], &b[0],
               &b[1], &b[2], &b[3]) != EOF) {
    for (int i = (int)0; i < (int)4; i++) use[a[i]] = 1;
    int hit = 0, blow = 0;
    for (int i = (int)0; i < (int)4; i++) {
      if (a[i] == b[i])
        hit++;
      else if (use[b[i]])
        blow++;
    }
    cout << hit << " " << blow << endl;
  }
  return 0;
}
