#include <bits/stdc++.h>
int judge_hit(int *r, int *a) {
  int hit;
  int i;
  hit = 0;
  for (i = 0; i < 4; i++) {
    if (r[i] == a[i]) {
      hit++;
    }
  }
  return hit;
}
int judge_blow(int *r, int *a) {
  int blow;
  int i, j;
  blow = 0;
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 4; j++) {
      if ((i != j) && (r[i] == a[j])) {
        blow++;
      }
    }
  }
  return blow;
}
int main() {
  char buf[40];
  int r[4], a[4];
  while (1) {
    fgets(buf, 40, stdin);
    if (sscanf(buf, "%d %d %d %d", a, a + 1, a + 2, a + 3) == EOF) break;
    fgets(buf, 40, stdin);
    sscanf(buf, "%d %d %d %d", r, r + 1, r + 2, r + 3);
    printf("%d %d\n", judge_hit(r, a), judge_blow(r, a));
  }
  return 0;
}
