#include <bits/stdc++.h>
using namespace std;
int hit(int str[], int str2[]) {
  int i, j = 0;
  for (i = 0; i < 4; i++) {
    if (str[i] == str2[i]) {
      j++;
    }
  }
  return j;
}
int blow(int str3[], int str4[]) {
  int i, j = 0;
  sort(str3, str3 + 4);
  sort(str4, str4 + 4);
  for (i = 0; i < 4; i++) {
    if (str3[i] == str4[i]) {
      j++;
    }
  }
  return j;
}
int main() {
  int str[4], str2[4];
  while (scanf("%d %d %d %d", &str[0], &str[1], &str[2], &str[3]) != EOF) {
    cin >> str2[0] >> str2[1] >> str2[2] >> str2[3];
    int hit_var = hit(str, str2);
    int blow_var = blow(str, str2);
    cout << hit_var << " " << blow_var - hit_var << endl;
  }
  return 0;
}
