#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  string s;
  string t;
  cin >> s >> t;
  uint32_t hurrah = 0;
  uint32_t ouch = 0;
  vector<uint32_t> letters_paper(128, 0);
  for (uint32_t i = 0; i < t.length(); i++) {
    letters_paper[t[i]]++;
  }
  for (uint32_t i = 0; i < s.length(); i++) {
    if (letters_paper[s[i]] > 0) {
      hurrah++;
      letters_paper[s[i]]--;
      s[i] = 1;
    }
  }
  uint32_t aA = 'A' - 'a';
  uint32_t Aa = 'a' - 'A';
  for (uint32_t i = 0; i < s.length(); i++) {
    if (s[i] >= 'a' && s[i] <= 'z') {
      if (letters_paper[s[i] + aA] > 0) {
        ouch++;
        letters_paper[s[i] + aA]--;
      }
      s[i] = 1;
    } else if (s[i] >= 'A' && s[i] <= 'Z') {
      if (letters_paper[s[i] + Aa] > 0) {
        ouch++;
        letters_paper[s[i] + Aa]--;
      }
      s[i] = 1;
    }
  }
  cout << hurrah << " " << ouch << endl;
  return 0;
}
