#include <bits/stdc++.h>
using namespace std;
int GCD(int x, int y) {
  if (x % y == 0)
    return y;
  else
    return (GCD(y, x % y));
}
int main() {
  string a, b;
  int i, j;
  int ara[124] = {0};
  while (cin >> a >> b) {
    int cn = 0, cnt = 0;
    for (i = 0; i < 124; i++) ara[i] = 0;
    for (i = 0; i < b.size(); i++) {
      ara[b[i]]++;
    }
    for (i = 0; i < a.size(); i++) {
      if (ara[a[i]]) {
        ara[a[i]]--;
        cn++;
        a[i] = '0';
      }
    }
    for (i = 0; i < a.size(); i++) {
      if ((a[i] >= 'a' && a[i] <= 'z') || (a[i] >= 'A' && a[i] <= 'Z')) {
        if (a[i] >= 'A' && a[i] <= 'Z') {
          if (ara[a[i] + 32]) {
            ara[a[i] + 32]--;
            cnt++;
          }
        } else {
          if (ara[a[i] - 32]) {
            ara[a[i] - 32]--;
            cnt++;
          }
        }
      }
    }
    cout << cn << " " << cnt << endl;
  }
  return 0;
}
