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