#include <bits/stdc++.h>
using namespace std;
const int MAX_N = (int)2e5;
bool used[MAX_N] = {};
char conv(char a) {
  if (a >= 'a' && a <= 'z')
    return char(a - 'a' + 'A');
  else if (a >= 'A' && a <= 'Z')
    return char(a - 'A' + 'a');
  return ' ';
}
int main() {
  string a, b;
  getline(cin, a);
  getline(cin, b);
  int cnt[256] = {}, ans1 = 0, ans2 = 0;
  for (int i = 0; i < b.size(); i++) cnt[(int)b[i]]++;
  for (int i = 0; i < a.size(); i++)
    if (!used[i] && cnt[(int)a[i]]) {
      ans1++;
      cnt[(int)a[i]]--;
      used[i] = true;
    }
  for (int i = 0; i < a.size(); i++) {
    if (!used[i] && cnt[(int)conv(a[i])]) {
      ans2++;
      cnt[(int)conv(a[i])]--;
      used[i] = true;
    }
  }
  cout << ans1 << " " << ans2;
  return 0;
}
