#include <bits/stdc++.h>
using namespace std;
char c[400005], d[400005];
int main() {
  int a[150] = {0}, b[150] = {0}, e[150] = {0}, f[150] = {0}, i, j, k, l, m,
      s1 = 0, s2 = 0;
  scanf("%s", c);
  scanf("%s", d);
  l = strlen(c);
  m = strlen(d);
  for (i = 0; i < l; i++) {
    a[c[i]]++;
    if (c[i] >= 'a')
      e[c[i] - 32]++;
    else
      e[c[i]]++;
  }
  for (i = 0; i < m; i++) {
    b[d[i]]++;
    if (d[i] >= 'a')
      f[d[i] - 32]++;
    else
      f[d[i]]++;
  }
  for (i = 0; i < 150; i++) {
    if (a[i] - b[i] > 0) s1 += a[i] - b[i];
    if (e[i] - f[i] > 0) s2 += e[i] - f[i];
  }
  cout << l - s1 << " " << s1 - s2 << endl;
}
