#include <bits/stdc++.h>
int main(void) {
  int a[8], x, i, c, d, e, f, g;
  for (i = 0; ~scanf("%d", a + i++);) {
    if (i == 8) {
      for (c = d = x = i = 0; i < 4; i++) {
        e = a[i];
        f = a[i + 4];
        if (e == f) c++;
        g = 1 << e | 1 << f;
        if (x & g) d++;
        x |= g;
      }
      i = !printf("%d %d\n", c, d);
    }
  }
  return 0;
}
