#include <bits/stdc++.h>
using namespace std;
int main() {
  int c[200] = {}, yay = 0, whoops = 0;
  auto inv = [](int c) -> int {
    return (c < 'a') ? c + 'a' - 'A' : c - 'a' + 'A';
  };
  string s, t, t2;
  cin >> s >> t;
  for (int i : s) c[i]++;
  for (int i : t) {
    if (c[i])
      c[i]--, yay++;
    else
      t2 += i;
  }
  for (int i : t2)
    if (c[inv(i)]) c[inv(i)]--, whoops++;
  cout << yay << " " << whoops;
}
