#include <bits/stdc++.h>
using namespace std;
char s[200010];
char t[200010];
map<char, int> a;
int main() {
  scanf("%s%s", s, t);
  int len = strlen(t);
  int ans1 = 0, ans2 = 0;
  for (int i = 0; i < len; i++) {
    a[t[i]]++;
  }
  int len1 = strlen(s);
  for (int i = 0; i < len1; i++)
    if (a[s[i]] > 0) {
      ans1++;
      a[s[i]]--;
      s[i] = '0';
    }
  for (int i = 0; i < len1; i++)
    if (s[i] != '0') {
      if (a[s[i] + 32]-- > 0 || a[s[i] - 32]-- > 0) ans2++;
    }
  printf("%d %d\n", ans1, ans2);
}
