#include <bits/stdc++.h>
using namespace std;
const int MaxN = int(2e5) + 256;
string s, t;
multiset<char> M;
int ura, opa;
bool u[MaxN];
int main() {
  cin >> s >> t;
  for (int i = 0; i < t.size(); ++i) M.insert(t[i]);
  for (int i = 0; i < s.size(); ++i) {
    if (M.find(s[i]) != M.end()) {
      M.erase(M.find(s[i]));
      ura++;
      u[i] = 1;
    }
  }
  for (int i = 0; i < s.size(); ++i) {
    if (M.find(toupper(s[i])) != M.end() && !u[i]) {
      M.erase(M.find(toupper(s[i])));
      u[i] = 1;
      opa++;
      continue;
    }
    if (M.find(tolower(s[i])) != M.end() && !u[i]) {
      M.erase(M.find(tolower(s[i])));
      u[i] = 1;
      opa++;
    }
  }
  cout << ura << " " << opa;
  return 0;
}
