#include <bits/stdc++.h>
int main(void) {
  int a[4], b[4];
  int a_number[10] = {0}, b_number[10] = {0};
  int hit, blow;
  int i;
  while (scanf("%d", &a[0]) != EOF) {
    hit = blow = 0;
    for (i = 1; i < 4; i++) {
      scanf(" %d", &a[i]);
      a_number[a[i]]++;
    }
    for (i = 0; i < 4; i++) {
      scanf(" %d", &b[i]);
      b_number[b[i]]++;
    }
    for (i = 0; i < 4; i++) {
      if (a[i] == b[i]) hit++;
    }
    for (i = 0; i < 10; i++) {
      blow += (a_number[i] < b_number[i]) ? a_number[i] : b_number[i];
    }
    blow -= hit;
    printf("%d %d\n", hit, blow);
  }
  return 0;
}
