#include <bits/stdc++.h>
using namespace std;
int i, j, k, l, n, m, f[200], f1[200], yay, whoops;
char s[200100], s1[200100];
int main() {
  memset(f, 0, sizeof(f));
  memset(f1, 0, sizeof(f1));
  scanf("%s", s);
  scanf("%s", s1);
  k = strlen(s);
  for (i = 0; i < k; i++) f[s[i]]++;
  k = strlen(s1);
  for (i = 0; i < k; i++) f1[s1[i]]++;
  for (i = 1; i <= 128; i++) {
    l = min(f[i], f1[i]);
    yay += l;
    f[i] -= l;
    f1[i] -= l;
  }
  for (i = 65; i <= 90; i++) whoops += min(f[i], f1[i + 32]);
  for (i = 97; i <= 123; i++) whoops += min(f[i], f1[i - 32]);
  printf("%d %d\n", yay, whoops);
}
