#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t;
  int ye = 0, wh = 0;
  cin >> s >> t;
  map<char, int> ss, tt;
  for (int i = 0; i < s.size(); ++i) {
    ss[s[i]]++;
  }
  for (int i = 0; i < t.size(); ++i) {
    tt[t[i]]++;
  }
  char temp;
  int value, tempValue;
  for (map<char, int>::iterator it = ss.begin(); it != ss.end(); it++) {
    temp = (it->first);
    value = (it->second);
    tempValue = min(tt[temp], value);
    ye += tempValue;
    ss[temp] -= tempValue;
    tt[temp] -= tempValue;
  }
  char temp2;
  for (map<char, int>::iterator it = ss.begin(); it != ss.end(); it++) {
    temp = (it->first);
    value = (it->second);
    if (value) {
      if (islower(temp)) {
        temp2 = toupper(temp);
        tempValue = min(tt[temp2], value);
        wh += tempValue;
        tt[temp2] -= tempValue;
      } else {
        temp2 = tolower(temp);
        tempValue = min(tt[temp2], value);
        wh += tempValue;
        tt[temp2] -= tempValue;
      }
    }
  }
  cout << ye << ' ' << wh << endl;
  return 0;
}
