#include <bits/stdc++.h>
int main(void) {
  int a[5], b[5];
  int i, j, hit, brrow, x, z;
  double stoped;
  x = 0, z = 0;
  hit = 0, brrow = 0;
  for (i = 0; i < 4; i++) {
    scanf("%d", &x);
    a[i] = x;
  }
  for (i = 0; i < 4; i++) {
    scanf("%d", &z);
    b[i] = z;
  }
  for (i = 0; i < 4; i++) {
    if (a[i] == b[i]) {
      hit++;
    }
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 4; j++) {
      if (a[i] == b[j] && i != j) {
        brrow++;
      }
    }
  }
  printf("%d %d\n", hit, brrow);
  return 0;
}
