#include <bits/stdc++.h>
using namespace std;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int main(void) {
  int a[4];
  int b[4];
  while (cin >> a[0]) {
    int hit = 0;
    int brow = 0;
    for (int i = 1; i < (int)(4); i++) {
      cin >> a[i];
    }
    for (int i = 0; i < (int)(4); i++) {
      cin >> b[i];
      if (a[i] == b[i]) hit++;
    }
    for (int i = 0; i < (int)(4); i++)
      for (int j = 0; j < (int)(4); j++) {
        if (a[i] != -1 || b[j] != -1) continue;
        if (a[i] == b[j]) {
          brow++;
          a[i] = -1;
          b[j] = -1;
        }
      }
    cout << hit << " " << (brow - hit) << endl;
  }
  return 0;
}
