#include <bits/stdc++.h>
using namespace std;
long long upperCase[26];
long long lowerCase[26];
long long taken[200005];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  string t;
  cin >> t >> s;
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] >= 'a') {
      lowerCase[s[i] - 'a']++;
    } else {
      upperCase[s[i] - 'A']++;
    }
  }
  long long countYay = 0;
  long long countWhoop = 0;
  for (long long i = 0; i < t.length(); i++) {
    if (t[i] >= 'a') {
      if (lowerCase[t[i] - 'a'] > 0) {
        countYay++;
        lowerCase[t[i] - 'a']--;
        taken[i] = 1;
      }
    } else {
      if (upperCase[t[i] - 'A'] > 0) {
        countYay++;
        upperCase[t[i] - 'A']--;
        taken[i] = 1;
      }
    }
  }
  for (long long i = 0; i < t.length(); i++) {
    if (t[i] >= 'a' && !taken[i]) {
      if (upperCase[t[i] - 'a'] > 0) {
        countWhoop++;
        upperCase[t[i] - 'a']--;
        taken[i] = 1;
      }
    } else if (!taken[i]) {
      if (lowerCase[t[i] - 'A'] > 0) {
        countWhoop++;
        lowerCase[t[i] - 'A']--;
        taken[i] = 1;
      }
    }
  }
  cout << countYay << " " << countWhoop << endl;
  return 0;
}
