#include <bits/stdc++.h>
using namespace std;
int x, y;
string a, b;
map<char, int> cnt;
int main() {
  cin >> a >> b;
  int n = a.size(), m = b.size();
  for (int i = 0; i < m; i++) cnt[b[i]]++;
  for (int i = 0; i < n; i++) {
    char c = a[i];
    if (cnt[c] > 0) {
      cnt[c]--;
      x++;
      a[i] = '#';
    }
  }
  for (int i = 0; i < n; i++) {
    char c = a[i];
    if (isupper(c))
      c = tolower(c);
    else
      c = toupper(c);
    if (cnt[c] > 0) {
      cnt[c]--;
      y++;
    }
  }
  cout << x << " " << y;
}
