#include <bits/stdc++.h>
using namespace std;
int hit(char str[], char str2[]) {
  int i, j = 0;
  for (i = 0; i < 4; i++) {
    if (str[i] == str2[i]) {
      j++;
    }
  }
  return j;
}
int blow(char str3[], char str4[]) {
  int i, j = 0;
  char str5[2] = "";
  for (i = 0; i < 4; i++) {
    strcpy(str5, "");
    strncat(str5, str4 + i, 1);
    if (strstr(str3, str5) != NULL) {
      j++;
    }
  }
  return j;
}
int main() {
  char str[5], str2[5];
  while (scanf("%c %c %c %c", &str[0], &str[1], &str[2], &str[3]) != EOF) {
    cin >> str2[0] >> str2[1] >> str2[2] >> str2[3];
    int hit_var = hit(str, str2);
    int blow_var = blow(str, str2);
    cout << hit_var << " " << blow_var - hit_var << endl;
  }
  return 0;
}
