#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using tpl = tuple<int, int, int>;
using pcc = pair<char, char>;
const int inf = 9999999;
const ll mod = 1e9 + 7;
int dr[] = {-1, 0, 1, 0};
int dc[] = {0, 1, 0, -1};
int kr[] = {-1, 1, -2, -2, -1, 1, 2, 2};
int kc[] = {-2, -2, -1, 1, 2, 2, -1, 1};
int dgr[] = {-1, -1, 1, 1};
int dgc[] = {1, -1, -1, 1};
int main() {
  string s, t;
  cin >> s >> t;
  int upr[28], lwr[28], up[28], lo[28];
  memset(upr, 0, sizeof upr);
  memset(lwr, 0, sizeof lwr);
  memset(up, 0, sizeof up);
  memset(lo, 0, sizeof lo);
  for (int i = t.size() - 1; i >= 0; i--) {
    if (isupper(t[i]))
      upr[t[i] - 'A']++;
    else
      lwr[t[i] - 'a']++;
  }
  int cnt1 = 0, cnt2 = 0;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (isupper(s[i]))
      up[s[i] - 'A']++;
    else
      lo[s[i] - 'a']++;
  }
  for (int i = 0; i < 26; i++) {
    int a = min(up[i], upr[i]);
    cnt1 += a;
    upr[i] -= a;
    up[i] -= a;
    a = min(lo[i], lwr[i]);
    cnt1 += a;
    lwr[i] -= a;
    lo[i] -= a;
    a = min(up[i], lwr[i]);
    cnt2 += a;
    a = min(lo[i], upr[i]);
    cnt2 += a;
  }
  printf("%d %d\n", cnt1, cnt2);
  return 0;
}
