#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 100;
char s[maxn], t[maxn];
int s_big[30], s_small[30], t_big[30], t_small[30];
int main() {
  while (scanf("%s%s", s + 1, t + 1) != EOF) {
    memset(s_big, 0, sizeof(s_big));
    memset(s_small, 0, sizeof(s_small));
    memset(t_big, 0, sizeof(t_big));
    memset(t_small, 0, sizeof(t_small));
    int len1 = strlen(s + 1);
    int len2 = strlen(t + 1);
    for (int i = 1; i <= len1; i++) {
      if (s[i] > 'Z') {
        s_small[s[i] - 'a']++;
      } else {
        s_big[s[i] - 'A']++;
      }
    }
    for (int i = 1; i <= len2; i++) {
      if (t[i] > 'Z') {
        t_small[t[i] - 'a']++;
      } else {
        t_big[t[i] - 'A']++;
      }
    }
    int ans1 = 0, ans2 = 0;
    for (int i = 0; i < 26; i++) {
      ans1 += min(s_small[i], t_small[i]);
      ans1 += min(s_big[i], t_big[i]);
      if (s_small[i] < t_small[i]) {
        t_small[i] -= s_small[i];
        s_small[i] = 0;
      } else {
        s_small[i] -= t_small[i];
        t_small[i] = 0;
      }
      if (s_big[i] < t_big[i]) {
        t_big[i] -= s_big[i];
        s_big[i] = 0;
      } else {
        s_big[i] -= t_big[i];
        t_big[i] = 0;
      }
    }
    for (int i = 0; i < 26; i++) {
      ans2 += min(s_small[i], t_big[i]);
      ans2 += min(s_big[i], t_small[i]);
    }
    printf("%d %d\n", ans1, ans2);
  }
  return 0;
}
