#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int mod = 1e9 + 7;
const int inf = 1e9;
const int N = 1e3 + 50;
char uwu(char c) {
  if (tolower(c) == c) return toupper(c);
  return tolower(c);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string second, t, tmp = "";
  cin >> second >> t;
  int n = t.size(), m = second.size(), ans1 = 0, ans2 = 0;
  map<char, int> cont;
  for (int i = 0; i < n; i++) {
    cont[t[i]]++;
  }
  for (int i = 0; i < m; i++) {
    if (cont[second[i]] > 0) {
      ans1++;
      cont[second[i]]--;
    } else
      tmp += second[i];
  }
  for (auto it : tmp) {
    if (cont[uwu(it)] > 0) {
      ans2++;
      cont[uwu(it)]--;
    }
  }
  cout << ans1 << " " << ans2 << '\n';
  return 0;
}
