#include <bits/stdc++.h>
using namespace std;
int freqs[130], freqt[130];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s, t;
  cin >> s >> t;
  memset(freqs, 0, sizeof(freqs));
  memset(freqt, 0, sizeof(freqt));
  for (int i = 0; i < s.length(); i++) freqs[s[i]]++;
  for (int i = 0; i < t.length(); i++) freqt[t[i]]++;
  int a = 0, b = 0;
  for (int i = 'A'; i <= 'z'; i++) {
    int tem = freqs[i] < freqt[i] ? freqs[i] : freqt[i];
    freqs[i] -= tem;
    freqt[i] -= tem;
    a += tem;
  }
  for (int i = 'A'; i <= 'z'; i++) {
    if (freqs[i] == 0) continue;
    if (i >= 'A' && i <= 'Z') {
      int tem = freqs[i] < freqt[i + 32] ? freqs[i] : freqt[i + 32];
      freqs[i] -= tem;
      freqt[i] -= tem;
      b += tem;
    } else {
      int tem = freqs[i] < freqt[i - 32] ? freqs[i] : freqt[i - 32];
      freqs[i] -= tem;
      freqt[i] -= tem;
      b += tem;
    }
  }
  cout << a << ' ' << b << endl;
  return 0;
}
