#include <bits/stdc++.h>
using namespace std;
int arr[500] = {0};
int main() {
  string str1, str2;
  cin >> str1 >> str2;
  int l, m, temp = 0, res = 0, res2 = 0;
  l = str1.length();
  m = str2.length();
  int mark[l];
  fill(mark, mark + l, 0);
  for (int i = 0; i < m; i++) {
    temp = str2[i];
    arr[temp]++;
  }
  for (int i = 0; i < l; i++) {
    temp = str1[i];
    if (arr[temp] > 0) {
      res++;
      mark[i] = 1;
      arr[temp]--;
    }
  }
  for (int i = 0; i < l; i++) {
    temp = str1[i];
    if (mark[i] == 1) continue;
    if (temp >= 65 && temp <= 90) {
      if (arr[temp + 32] > 0) {
        res2++;
        arr[temp + 32]--;
      }
    } else if (temp >= 97 && temp <= 122) {
      if (arr[temp - 32] > 0) {
        res2++;
        arr[temp - 32]--;
      }
    }
  }
  cout << res << " " << res2 << endl;
  return 0;
}
