#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[4], b[4], ans, res;
  bool vis[4];
  while (scanf("%d", &a[0]) == 1) {
    ans = res = 0;
    memset(vis, true, sizeof(vis));
    for (int i = 1; i < 4; i++) scanf("%d", &a[i]);
    for (int i = 0; i < 4; i++) scanf("%d", &b[i]);
    for (int i = 0; i < 4; i++)
      if (a[i] == b[i]) {
        ans++;
        vis[i] = false;
      }
    for (int i = 0; i < 4; i++)
      if (vis[i])
        for (int j = i + 1; j < 4; j++)
          if (vis[j]) {
            if (a[i] == b[j]) {
              vis[j] = false;
              res++;
            }
          }
    printf("%d %d\n", ans, res);
  }
  return 0;
}
