#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  string s;
  string t;
  cin >> s >> t;
  map<char, int> freqS;
  map<char, int> freqT;
  for (int ii = 0; ii < s.length(); ++ii) {
    ++freqS[s[ii]];
  }
  for (int ii = 0; ii < t.length(); ++ii) {
    ++freqT[t[ii]];
  }
  int common;
  int yaycnt = 0;
  for (char cc = 'a'; cc <= 'z'; ++cc) {
    common = min(freqS[cc], freqT[cc]);
    yaycnt += common;
    freqS[cc] -= common;
    freqT[cc] -= common;
  }
  for (char cc = 'A'; cc <= 'Z'; ++cc) {
    common = min(freqS[cc], freqT[cc]);
    yaycnt += common;
    freqS[cc] -= common;
    freqT[cc] -= common;
  }
  int whoopscnt = 0;
  for (char cc = 'a'; cc <= 'z'; ++cc) {
    char upper = cc - 'a' + 'A';
    common = min(freqS[cc], freqT[upper]);
    whoopscnt += common;
    freqS[cc] -= common;
    freqT[upper] -= common;
  }
  for (char cc = 'A'; cc <= 'Z'; ++cc) {
    char lower = cc - 'A' + 'a';
    common = min(freqS[cc], freqT[lower]);
    whoopscnt += common;
    freqS[cc] -= common;
    freqT[lower] -= common;
  }
  cout << yaycnt << " " << whoopscnt << endl;
  return 0;
}
