#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int n, m, x = 0;
  n = s1.length();
  m = s2.length();
  map<char, int> M, N;
  for (int i = 0; i < m; i++) {
    M[s2[i]]++;
  }
  for (int i = 0; i < n; i++) {
    N[s1[i]]++;
  }
  int y = 0, w = 0;
  char z;
  for (int i = 0; i < 26; i++) {
    z = (char)(i + 'a');
    x = min(M[z], N[z]);
    N[z] -= x;
    M[z] -= x;
    y += x;
    z = (char)(i + 'A');
    x = min(M[z], N[z]);
    N[z] -= x;
    M[z] -= x;
    y += x;
  }
  for (auto i : N) {
    if (i.second != 0) {
      if (i.first >= 'A' && i.first < 'a') {
        z = (char)(i.first - 'A' + 'a');
        w += min(i.second, M[z]);
        M[z] -= min(i.second, M[z]);
      }
      if (i.first >= 'a') {
        z = (char)(i.first - 'a' + 'A');
        w += min(i.second, M[z]);
        M[z] -= min(i.second, M[z]);
      }
    }
  }
  cout << y << " " << w << endl;
}
