#include <bits/stdc++.h>
using namespace std;
string a, b;
int ans1, ans2, cnt[244];
bool u[222222];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> a >> b;
  for (int i = 0; i < b.size(); i++) cnt[b[i]]++;
  for (int i = 0; i < a.size(); i++) {
    if (cnt[a[i]] > 0) {
      u[i] = 1;
      ans1++;
      cnt[a[i]]--;
    }
  }
  for (int i = 0; i < a.size(); i++) {
    if (u[i]) continue;
    if (a[i] >= 'A' && a[i] <= 'Z' && cnt[a[i] + 32] > 0) {
      ans2++;
      cnt[a[i] + 32]--;
    } else if (a[i] >= 'a' && a[i] <= 'z' && cnt[a[i] - 32] > 0) {
      ans2++;
      cnt[a[i] - 32]--;
    }
  }
  cout << ans1 << ' ' << ans2;
  return 0;
}
