#include <bits/stdc++.h>
using namespace std;
string s, t;
int as[125], at[125], sum, te;
int main() {
  cin >> s >> t;
  for (int i = 0; i < s.length(); i++) as[s[i]]++;
  for (int i = 0; i < t.length(); i++) at[t[i]]++;
  for (int i = 'a'; i <= 'z'; i++)
    te = as[i], sum += min(as[i], at[i]), as[i] -= min(as[i], at[i]),
    at[i] -= min(te, at[i]);
  for (int i = 'A'; i <= 'Z'; i++)
    te = as[i], sum += min(as[i], at[i]), as[i] -= min(as[i], at[i]),
    at[i] -= min(te, at[i]);
  cout << sum << " ";
  sum = 0;
  for (int i = 'a'; i <= 'z'; i++)
    te = as[i], sum += min(as[i], at[i - ('a' - 'A')]),
    as[i] -= min(as[i], at[i - ('a' - 'A')]),
    at[i - ('a' - 'A')] -= min(te, at[i - ('a' - 'A')]);
  for (int i = 'A'; i <= 'Z'; i++)
    te = as[i], sum += min(as[i], at[i + 'a' - 'A']),
    as[i] -= min(as[i], at[i + 'a' - 'A']),
    at[i + 'a' - 'A'] -= min(te, at[i + 'a' - 'A']);
  cout << sum << endl;
  return 0;
}
