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