#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  map<char, int> secondString;
  map<char, int> firstString;
  int n1 = a.size();
  int n2 = b.size();
  int yay = 0;
  int whoops = 0;
  for (auto x : b) secondString[x]++;
  for (auto x : a) firstString[x]++;
  for (auto x : a) {
    if (secondString[x]) {
      yay++;
      secondString[x]--;
      firstString[x]--;
    }
  }
  for (auto x : a) {
    if (x >= 'a' && x <= 'z') {
      char tryThis = x - 32;
      if (secondString[tryThis] && firstString[x]) {
        whoops++;
        secondString[tryThis]--;
        firstString[x]--;
      }
    } else {
      char tryThis = x + 32;
      if (secondString[tryThis] && firstString[x]) {
        whoops++;
        secondString[tryThis]--;
        firstString[x]--;
      }
    }
  }
  printf("%d %d\n", yay, whoops);
  return 0;
}
