#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int yays = 0, whoops = 0;
  map<char, int> count1, count2;
  for (int i = 0; i < s1.size(); i++) {
    count1[s1[i]]++;
  }
  for (int i = 0; i < s2.size(); i++) {
    count2[s2[i]]++;
  }
  char c = 'a';
  char d = c - 32;
  map<char, int>::iterator it;
  for (it = count1.begin(); it != count1.end(); it++) {
    char c = (*it).first;
    int i1, i2;
    i1 = it->second;
    if (count2.count(c) == 0) {
      continue;
    } else {
      i2 = count2[c];
    }
    if (i1 <= i2) {
      yays += i1;
      count1[c] = 0;
      count2[c] = i2 - i1;
    } else {
      yays += i2;
      count1[c] = i1 - i2;
      count2[c] = 0;
    }
  }
  cout << yays << " ";
  for (it = count1.begin(); it != count1.end(); it++) {
    char c = (*it).first;
    char c_other;
    if ((int)c > 90) {
      c_other = c - 32;
    } else {
      c_other = c + 32;
    }
    int i1 = it->second;
    int i2 = count2[c_other];
    if (i1 == 0)
      continue;
    else {
      if (i1 <= i2) {
        whoops += i1;
        count1[c] = 0;
        count2[c_other] = i2 - i1;
      } else {
        whoops += i2;
        count1[c] = i1 = i2;
        count2[c_other] = 0;
      }
    }
  }
  cout << whoops << endl;
}
