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