#include <bits/stdc++.h>
using namespace std;
int aa[256], a[26];
int b[26], bb[256];
int main() {
  string s, s2, ss, ss2;
  cin >> s >> s2;
  if (s2.size() < s.size()) {
    string s3 = s;
    s = s2;
    s2 = s3;
  }
  long long t1 = 0, t2 = 0;
  for (int i = 0; i < (int)s2.size(); i++) {
    aa[(int)s2[i]]++;
    if ((int)s2[i] <= 65 + 26)
      a[(int)s2[i] - 65]++;
    else
      a[(int)s2[i] - 97]++;
  }
  for (int i = 0; i < (int)s.size(); i++) {
    bb[(int)s[i]]++;
    if ((int)s[i] <= 65 + 26)
      b[(int)s[i] - 65]++;
    else
      b[(int)s[i] - 97]++;
  }
  for (int i = 0; i < 256; i++) {
    t1 += min(aa[i], bb[i]);
  }
  for (int i = 0; i < 26; i++) {
    t2 += min(a[i], b[i]);
  }
  t2 -= t1;
  cout << t1 << " " << t2;
  return 0;
}
