#include <bits/stdc++.h>
using namespace std;
char small[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
char capital[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
                  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
                  'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
map<char, int> mps;
map<char, int> mpt;
int main() {
  string s, t;
  cin >> s >> t;
  long long siz = s.size();
  for (int i = 0; i < siz; i++) {
    mps[s[i]]++;
  }
  siz = t.size();
  for (int i = 0; i < siz; i++) {
    mpt[t[i]]++;
  }
  long long yay = 0, whoops = 0;
  for (int i = 0; i < 26; i++) {
    if (mpt[small[i]] >= mps[small[i]]) {
      mpt[small[i]] -= mps[small[i]];
      yay += mps[small[i]];
      mps[small[i]] = 0;
    } else {
      mps[small[i]] -= mpt[small[i]];
      yay += mpt[small[i]];
      mpt[small[i]] = 0;
    }
    if (mpt[capital[i]] >= mps[capital[i]]) {
      mpt[capital[i]] -= mps[capital[i]];
      yay += mps[capital[i]];
      mps[capital[i]] = 0;
    } else {
      mps[capital[i]] -= mpt[capital[i]];
      yay += mpt[capital[i]];
      mpt[capital[i]] = 0;
    }
  }
  for (int i = 0; i < 26; i++) {
    if (mps[small[i]] && mpt[capital[i]]) {
      whoops += min(mps[small[i]], mpt[capital[i]]);
    }
    if (mps[capital[i]] && mpt[small[i]]) {
      whoops += min(mps[capital[i]], mpt[small[i]]);
    }
  }
  cout << yay << " " << whoops << endl;
  return 0;
}
