#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const double pi = acos(-1);
vector<char> a(4), b(4);
int main() {
  char c, d, e, f;
  while (cin >> c >> d >> e >> f) {
    int hit = 0, blow = 0;
    a = {c, d, e, f};
    for (int i = 0; i < 4; i++) cin >> b[i];
    for (int i = 0; i < 4; i++) {
      if (a[i] == b[i]) hit++;
    }
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < 4; j++) {
        if (i == j) continue;
        if (a[i] == b[j]) blow++;
      }
    }
    cout << hit << ' ' << blow << endl;
  }
}
