#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  long long int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  map<char, long long int> m1, m2;
  for (int i = 0; i < s1.size(); i++) m1[s1[i]]++;
  for (int i = 0; i < s2.size(); i++) m2[s2[i]]++;
  for (int i = 0; i < s1.size(); i++) {
    if (m2[s1[i]] > 0) {
      c1++;
      m2[s1[i]]--;
      m1[s1[i]]--;
    }
  }
  string s3 = "";
  for (auto x : m1) {
    for (int i = 0; i < x.second; i++) s3 += x.first;
  }
  for (int i = 0; i < s3.size(); i++) {
    if (s3[i] >= 65 && s3[i] <= 90) {
      if (m2[s3[i] + 32] > 0) {
        c2++;
        m2[s3[i] + 32]--;
      }
    } else {
      if (m2[s3[i] - 32] > 0) {
        c2++;
        m2[s3[i] - 32]--;
      }
    }
  }
  cout << c1 << " " << c2 << endl;
  return 0;
}
