#include <bits/stdc++.h>
using namespace std;
string s, t;
unordered_map<char, int> mp, ase;
set<char> st;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> s >> t;
  for (auto i : s) {
    mp[i]++;
    st.insert(i);
  }
  for (auto i : t) {
    ase[i]++;
  }
  int l = 0, r = 0;
  for (auto i : st) {
    int val = min(mp[i], ase[i]);
    l += val;
    mp[i] -= val, ase[i] -= val;
  }
  for (auto i : st) {
    if (i >= 'A' && i <= 'Z' && mp[i]) {
      r += min(mp[i], ase[(i - 'A') + 'a']);
    } else if (i >= 'a' && i <= 'z' && mp[i]) {
      r += min(mp[i], ase[(i - 'a') + 'A']);
    }
  }
  cout << l << " " << r << "\n";
  return 0;
}
