#include <bits/stdc++.h>
using namespace std;
int main() {
  int s;
  while (cin >> s) {
    int a[4];
    int b[4];
    a[0] = s;
    for (int(i) = 0; (i) < (3); (i)++) cin >> a[i + 1];
    for (int(i) = 0; (i) < (4); (i)++) cin >> b[i];
    int hit = 0;
    for (int(i) = 0; (i) < (4); (i)++) {
      if (a[i] == b[i]) hit++;
    }
    int blow = 0;
    for (int(i) = 0; (i) < (4); (i)++) {
      if (find(begin(a), end(a), b[i]) != end(a)) blow++;
    }
    cout << hit << " " << blow - hit;
  }
  return 0;
}
