#include <bits/stdc++.h>
using namespace std;
int main() {
  while (1) {
    int d[3], c[3], y, g = 0, b = 0;
    for (int i = 0; i < 8; i++) {
      cin >> y;
      if (i < 4) {
        d[i] = y;
      } else {
        c[i] = y;
      }
    }
    for (int j = 0; j < 4; j++) {
      if (d[j] == c[j]) {
        g++;
      }
      for (int k = 0; k < 4; k++) {
        if (d[j] == c[k] && j != k) {
          b++;
        }
      }
    }
    cout << g << " " << b << endl;
  }
  return 0;
}
