#include <bits/stdc++.h>
using namespace std;
bool mark[2 * 100005];
int cnt[500];
string s1, s2;
int main(int argc, char const* argv[]) {
  getline(cin, s1);
  getline(cin, s2);
  int l1, l2;
  l1 = s1.length(), l2 = s2.length();
  for (int i = (0); i < (l2); i++) {
    cnt[s2[i]]++;
  }
  char ch;
  int r1 = 0, r2 = 0;
  for (int i = (0); i < (l1); i++) {
    if (cnt[s1[i]]) {
      cnt[s1[i]]--;
      mark[i] = 1;
      r1++;
    }
  }
  for (int i = (0); i < (l1); i++) {
    if (mark[i]) continue;
    if (islower(s1[i]))
      ch = toupper(s1[i]);
    else
      ch = tolower(s1[i]);
    if (cnt[ch]) {
      cnt[ch]--;
      r2++;
    }
  }
  printf("%d %d\n", r1, r2);
  return 0;
}
