#include <bits/stdc++.h>
using namespace std;
int main() {
  string u, v;
  cin >> u >> v;
  vector<int> s(26), S(26), t(26), T(26);
  int yay = 0;
  int whoops = 0;
  for (int i = 0; i < u.size(); i++) {
    if (u[i] - 'A' > 25)
      s[u[i] - 'a']++;
    else
      S[u[i] - 'A']++;
  }
  for (int i = 0; i < v.size(); i++) {
    if (v[i] - 'A' > 25)
      t[v[i] - 'a']++;
    else
      T[v[i] - 'A']++;
  }
  for (int i = 0; i < 26; i++) {
    yay += min(s[i], t[i]) + min(S[i], T[i]);
  }
  for (int i = 0; i < 26; i++) {
    if ((t[i] < s[i] || T[i] < S[i]) && (t[i] > s[i] || T[i] > S[i])) {
      whoops += min(abs(s[i] - t[i]), abs(S[i] - T[i]));
    }
  }
  cout << yay << " " << whoops;
  return 0;
}
