#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans % m;
}
const long long N = 2e5 + 8;
const long long INF = 1e18;
int prime[N] = {0};
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  map<char, long long> mp;
  long long y = 0, w = 0;
  set<long long> s;
  for (long long i = 0; i < s2.length(); i++) {
    mp[s2[i]]++;
  }
  for (long long i = 0; i < s1.length(); i++) {
    if (mp[s1[i]] >= 1) {
      y++;
      mp[s1[i]]--;
      s.insert(i);
    }
  }
  for (long long i = 0; i < s1.length(); i++) {
    if (s.find(i) == s.end()) {
      if (isupper(s1[i])) {
        char ch = tolower(s1[i]);
        if (mp[ch] >= 1) {
          w++;
          mp[ch]--;
        }
      } else {
        char ch = toupper(s1[i]);
        if (mp[ch] >= 1) {
          w++;
          mp[ch]--;
        }
      }
    }
  }
  cout << y << ' ' << w << endl;
}
