#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s, st;
  int n, t, T, i, j, J, I, k, m;
  char ch;
  bool f;
  int frq1[28] = {0};
  int let1[28] = {0};
  int let2[28] = {0};
  int frq2[28] = {0};
  cin >> s;
  cin >> st;
  for (i = 0; i < st.length(); i++) {
    ch = st[i];
    if (ch < 'a') {
      m = ch - 'A';
      f = 1;
    } else {
      m = ch - 'a';
      f = 0;
    }
    if (f)
      frq1[m]++;
    else
      frq2[m]++;
  }
  n = 0;
  k = 0;
  for (i = 0; i < s.length(); i++) {
    ch = s[i];
    if (ch < 'a') {
      m = ch - 'A';
      f = 1;
    } else {
      m = ch - 'a';
      f = 0;
    }
    if (f)
      let1[m]++;
    else
      let2[m]++;
  }
  for (i = 0; i < 26; i++) {
    m = min(frq1[i], let1[i]);
    frq1[i] -= m;
    let1[i] -= m;
    n += m;
    m = min(frq2[i], let2[i]);
    frq2[i] -= m;
    let2[i] -= m;
    n += m;
  }
  for (i = 0; i < 26; i++) {
    m = min(frq1[i], let2[i]);
    frq1[i] -= m;
    let2[i] -= m;
    k += m;
    m = min(frq2[i], let1[i]);
    frq2[i] -= m;
    let1[i] -= m;
    k += m;
  }
  cout << n << " " << k;
  return 0;
}
