#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, M = 1e9 + 7;
const double pi = acos(-1.0), eps = 1e-9;
int dx4[] = {-1, 0, 1, 0};
int dy4[] = {0, 1, 0, -1};
char a[N], b[N];
int cnt[1000];
int main() {
  scanf("%s", a);
  scanf("%s", b);
  int l1 = strlen(a);
  int l2 = strlen(b);
  for (int i = 0; i < l2; i++) {
    cnt[b[i]]++;
  }
  int x = 0, y = 0;
  for (int i = 0; i < l1; i++) {
    if (cnt[a[i]]) {
      x++;
      cnt[a[i]]--;
      a[i] = '*';
    }
  }
  for (int i = 0; i < l1; i++) {
    if (a[i] != '*') {
      if (isupper(a[i])) {
        int p = a[i] + 'a' - 'A';
        if (cnt[p]) {
          y++;
          cnt[p]--;
        }
      } else {
        int p = a[i] + 'A' - 'a';
        if (cnt[p]) {
          y++;
          cnt[p]--;
        }
      }
    }
  }
  cout << x << " " << y << endl;
  return 0;
}
