#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[4], b[4];
  int d[10];
  int n, m;
  while (1) {
    n = m = 0;
    memset(d, 0, sizeof(d));
    for (int i = 0; i < 4; i++) scanf("%d", &a[i]);
    for (int i = 0; i < 4; i++) {
      scanf("%d", &b[i]);
      if (a[i] == b[i])
        n++;
      else {
        d[a[i]]++;
        d[b[i]]++;
      }
    }
    if (a[0] == EOF) break;
    if (n == 4)
      printf("%d %d\n", n, m);
    else {
      for (int i = 0; i <= 9; i++) {
        if (d[i] == 2) m++;
      }
      printf("%d %d\n", n, m);
    }
  }
  return 0;
}
