#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t, s1;
  int c[200] = {0}, y = 0, w = 0;
  cin >> s >> t;
  for (int i = 0; i < t.size(); i++) c[t[i]]++;
  for (int i = 0; i < s.size(); i++) {
    if (c[s[i]] > 0) {
      y++;
      c[s[i]]--;
    } else
      s1 += s[i];
  }
  for (int i = 0; i < s1.size(); i++) {
    if (c[s1[i] - 32] > 0) {
      c[s1[i] - 32]--;
      w++;
    } else if (c[s1[i] + 32] > 0) {
      c[s1[i] + 32]--;
      w++;
    }
  }
  cout << y << " " << w;
  return 0;
}
