#include <bits/stdc++.h>
using namespace std;
string s, t;
map<char, int> cnt;
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> s >> t;
  int cntSame, cntDiff;
  cntSame = cntDiff = 0;
  for (int i = 0, _n = (s.size()); i < _n; i = i + 1) cnt[s[i]]--;
  for (int i = 0, _n = (t.size()); i < _n; i = i + 1) {
    if (cnt[t[i]] < 0) cntSame++;
    cnt[t[i]]++;
  }
  for (int i = ('a'), _b = ('z'); i <= _b; i = i + 1) {
    int j = i - 'a' + 'A';
    if (cnt[i] > 0 && cnt[j] < 0) cntDiff += min(cnt[i], -cnt[j]);
    if (cnt[i] < 0 && cnt[j] > 0) cntDiff += min(-cnt[i], cnt[j]);
  }
  cout << cntSame << " " << cntDiff << endl;
  return 0;
}
