#include <bits/stdc++.h>
int main(void) {
  int sum1[4], sum2[4];
  int i, j, hit, blow;
  hit = blow = 0;
  while (scanf("%d%d%d%d\n%d%d%d%d", &sum1[0], &sum1[1], &sum1[2], &sum1[3],
               &sum2[0], &sum2[1], &sum2[2], &sum2[3]) != EOF) {
    for (i = 0; i < 4; i++) {
      for (j = 0; j < 4; j++)
        if (sum1[i] == sum2[j]) blow++;
    }
    for (i = 0; i < 4; i++)
      if (sum1[i] == sum2[i]) hit++;
    printf("%d %d\n", hit, blow);
  }
  return 0;
}
