#include <bits/stdc++.h>
using namespace std;
char Ccase(char c) {
  if (tolower(c) == c) return toupper(c);
  return tolower(c);
}
int main(void) {
  string s, s2, s3;
  long long m2[500];
  long long yay = 0, who = 0;
  memset(m2, 0, sizeof(m2));
  cin >> s >> s2;
  for (char c : s2) m2[c]++;
  for (char c : s) {
    if (m2[c] > 0) {
      yay++;
      m2[c]--;
    } else {
      s3 += c;
    }
  }
  for (char c : s3) {
    if (m2[Ccase(c)] > 0) {
      who++;
      m2[Ccase(c)]--;
    }
  }
  cout << yay << ' ' << who << '\n';
}
