#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[5], b[5], i, j, x, y;
  while (~scanf("%d%d%d%d", a, a + 1, a + 2, a + 3)) {
    x = y = 0;
    for (i = 0; i < 4; i++) scanf("%d", b + i);
    for (i = 0; i < 4; i++) {
      if (a[i] == b[i]) ++x;
      for (j = i + 1; j < 4; j++)
        if (a[i] == b[j]) ++y;
    }
    printf("%d %d\n", x, y);
  }
  return 0;
}
