#include <bits/stdc++.h>
using namespace std;
int cnt[200];
int main() {
  int i, ans1 = 0, ans2 = 0;
  string s, t;
  cin >> s >> t;
  for (i = 0; i < t.length(); i++) cnt[int(t[i])]++;
  for (i = 0; i < s.length(); i++) {
    if (cnt[int(s[i])]) {
      ans1++;
      cnt[int(s[i])]--;
      s[i] = '*';
    }
  }
  for (i = 0; i < s.length(); i++) {
    if (s[i] == '*') continue;
    int val = int(s[i]);
    if (val > 90)
      s[i] = toupper(s[i]);
    else
      s[i] = tolower(s[i]);
    if (cnt[int(s[i])]) {
      ans2++;
      cnt[int(s[i])]--;
    }
  }
  cout << ans1 << " " << ans2 << endl;
  return 0;
}
