#include <bits/stdc++.h>
using namespace std;
char str1[200050], str2[200050];
int vis[280];
int main() {
  while (cin >> str1 >> str2) {
    int len = strlen(str2);
    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < len; i++) {
      vis[str2[i]]++;
    }
    int len1 = strlen(str1);
    int sum = 0;
    int sum1 = 0;
    for (int i = 0; i < len1; i++) {
      if (vis[str1[i]]) {
        sum++;
        vis[str1[i]]--;
        str1[i] = 0;
      }
    }
    for (int i = 0; i < len1; i++) {
      if (str1[i] < 'a') {
        if (vis[str1[i] + 32]) {
          sum1++;
          vis[str1[i] + 32]--;
        }
      }
      if (str1[i] > 'Z') {
        if (vis[str1[i] - 32]) {
          sum1++;
          vis[str1[i] - 32]--;
        }
      }
    }
    cout << sum << " " << sum1 << endl;
  }
  return 0;
}
