#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[4], b[4];
  for (int i = 0; i < 4; i++) cin >> a[i];
  for (int i = 0; i < 4; i++) cin >> b[i];
  int hit = 0, blow = 0;
  if (a[0] == b[0]) hit++;
  if (a[1] == b[1]) hit++;
  if (a[2] == b[2]) hit++;
  if (a[3] == b[3]) hit++;
  if (a[0] == b[1]) blow++;
  if (a[1] == b[2]) blow++;
  if (a[2] == b[3]) blow++;
  if (a[1] == b[0]) blow++;
  if (a[2] == b[1]) blow++;
  if (a[2] == b[0]) blow++;
  if (a[3] == b[2]) blow++;
  if (a[3] == b[1]) blow++;
  if (a[3] == b[0]) blow++;
  if (a[0] == b[2]) blow++;
  if (a[1] == b[3]) blow++;
  if (a[0] == b[3]) blow++;
  cout << hit << " " << blow << "\n";
  return 0;
}
