#include <bits/stdc++.h>
int main() {
  std::string s, t;
  std::map<char, int> a, b;
  std::cin >> s >> t;
  for (int i = 0; i < s.length(); ++i) {
    ++a[s[i]];
  }
  for (int i = 0; i < t.length(); ++i) {
    ++b[t[i]];
  }
  int ansU = 0, ansO = 0;
  for (char ch = 'a'; ch <= 'z'; ++ch) {
    int k = std::min(a[ch], b[ch]);
    ansU += k;
    a[ch] -= k;
    b[ch] -= k;
    char ch2 = ch - 'a' + 'A';
    k = std::min(a[ch2], b[ch2]);
    ansU += k;
    a[ch2] -= k;
    b[ch2] -= k;
    ansO += std::min(a[ch] + a[ch2], b[ch] + b[ch2]);
  }
  std::cout << ansU << ' ' << ansO;
}
