#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  int flag = 0;
  int mp1[130] = {0};
  int mp2[130] = {0};
  for (int i = 0; a[i]; i++) mp1[a[i]]++;
  for (int i = 0; b[i]; i++) mp2[b[i]]++;
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < 130; i++) {
    int temp = min(mp1[i], mp2[i]);
    cnt1 += temp;
    mp1[i] -= temp;
    mp2[i] -= temp;
  }
  int i = 65, j = 97;
  while (i <= 90) {
    cnt2 += min(mp1[i], mp2[j]);
    i++;
    j++;
  }
  i = 65, j = 97;
  while (i <= 90) {
    cnt2 += min(mp1[j], mp2[i]);
    i++;
    j++;
  }
  cout << cnt1 << " " << cnt2 << endl;
  return 0;
}
