#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[200005], t[200005];
  long long int i, y, w;
  y = 0;
  w = 0;
  scanf("%s%s", s, t);
  long long int sl[300], tl[300];
  for (i = 0; i < 300; ++i) {
    sl[i] = 0;
    tl[i] = 0;
  }
  i = 0;
  while (s[i] != '\0') {
    sl[(int)s[i]]++;
    i++;
  }
  i = 0;
  while (t[i] != '\0') {
    if (sl[(int)t[i]] > 0) {
      y++;
      sl[(int)t[i]]--;
      t[i] = '*';
    }
    i++;
  }
  i = 0;
  while (t[i] != '\0') {
    if (t[i] != '*') {
      if (sl[((int)t[i]) + 32] > 0) {
        w++;
        sl[((int)t[i]) + 32]--;
      } else {
        if (sl[((int)t[i]) - 32] > 0) {
          w++;
          sl[((int)t[i]) - 32]--;
        }
      }
    }
    i++;
  }
  cout << y << " " << w << endl;
  return 0;
}
