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