#include <bits/stdc++.h>
using namespace std;
int main() {
  long int i, len1, len2, y = 0, caps1[26] = {0}, small1[26] = {0},
                          caps2[26] = {0}, small2[26] = {0}, w = 0;
  char s[200005], t[200005];
  scanf("%s", s);
  scanf("%s", t);
  len1 = strlen(s);
  len2 = strlen(t);
  for (i = 0; i < len1; i++) {
    if (s[i] >= 'A' && s[i] <= 'Z')
      caps1[s[i] - 'A']++;
    else
      small1[s[i] - 'a']++;
  }
  for (i = 0; i < len2; i++) {
    if (t[i] >= 'A' && t[i] <= 'Z')
      caps2[t[i] - 'A']++;
    else
      small2[t[i] - 'a']++;
  }
  for (i = 0; i < 26; i++) {
    y += min(caps1[i], caps2[i]);
    y += min(small1[i], small2[i]);
    caps1[i] -= caps2[i];
    small1[i] -= small2[i];
    if (caps1[i] > 0 && small1[i] < 0) w += min(abs(small1[i]), caps1[i]);
    if (caps1[i] < 0 && small1[i] > 0) w += min(abs(caps1[i]), small1[i]);
  }
  printf("%ld %ld", y, w);
}
