#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, s1;
  cin >> s >> s1;
  int yay = 0, woops = 0;
  map<char, int> occ;
  string left;
  for (char c : s1) occ[c]++;
  for (char c : s) {
    if (occ[c] > 0) {
      yay++;
      occ[c]--;
    } else {
      left += c;
    }
  }
  for (char c : left) {
    if (islower(c)) {
      if (occ[toupper(c)] > 0) {
        woops++;
        occ[toupper(c)]--;
      }
    } else {
      if (occ[tolower(c)] > 0) {
        woops++;
        occ[tolower(c)]--;
      }
    }
  }
  cout << yay << " " << woops << endl;
}
