#include <bits/stdc++.h>
using namespace std;
const int OO = 0x3f3f3f3f, N = 2e5 + 5, mod = 1e9 + 7;
string s, t;
int arr[200], a, b;
bool flag[N];
int main() {
  cin >> s >> t;
  for (char ch : t) ++arr[ch];
  for (int i = 0; i < s.size(); ++i) {
    if (arr[s[i]]) flag[i] = 1, ++a, --arr[s[i]];
  }
  for (int i = 0; i < s.size(); ++i) {
    if (flag[i]) continue;
    if (arr[s[i] + ((s[i] >= 'a') ? ('A' - 'a') : ('a' - 'A'))])
      ++b, --arr[s[i] + ((s[i] >= 'a') ? ('A' - 'a') : ('a' - 'A'))];
  }
  cout << a << " " << b;
  return 0;
}
