#include <bits/stdc++.h>
using namespace std;
string a, b;
int slova[1 << 8];
int yay, whoops;
int bio[200010];
int main() {
  cin >> a >> b;
  for (int i = 0; i < b.size(); i++) {
    slova[b[i]]++;
  }
  for (int i = 0; i < a.size(); i++) {
    if (slova[a[i]]) {
      yay++;
      slova[a[i]]--;
      bio[i]++;
    }
  }
  for (int i = 0; i < a.size(); i++) {
    if (!bio[i]) {
      if (a[i] >= 'a') {
        if (slova[a[i] - 32]) {
          slova[a[i] - 32]--;
          whoops++;
        }
      } else {
        if (slova[a[i] + 32]) {
          slova[a[i] + 32]--;
          whoops++;
        }
      }
    }
  }
  cout << yay << ' ' << whoops;
  return 0;
}
