#include <bits/stdc++.h>
using namespace std;
int ans1 = 0, ans2 = 0, a[129] = {}, b[129] = {};
int main() {
  string s, t;
  cin >> s >> t;
  for (int i = 0; i < s.size(); i++) {
    a[s[i]]++;
  }
  for (int i = 0; i < t.size(); i++) {
    b[t[i]]++;
  }
  for (int i = 0; i < 128; i++) {
    int r = min(a[i], b[i]);
    ans1 += r;
    a[i] -= r;
    b[i] -= r;
  }
  for (int i = 'a'; i <= 'z'; i++) {
    int j = i - 'a' + 'A';
    int r = min(a[i], b[j]);
    ans2 += r;
    a[i] -= r;
    b[j] -= r;
    r = min(a[j], b[i]);
    ans2 += r;
    a[j] -= r;
    b[i] -= r;
  }
  cout << ans1 << " " << ans2;
  return 0;
}
