#include <bits/stdc++.h>
using namespace std;
int numbers1[200];
int numbers2[200];
string s1, s2;
int main() {
  cin >> s1 >> s2;
  int yay = 0;
  int whoops = 0;
  for (int i = 0; i < 200; i++) {
    numbers1[i] = 0;
    numbers2[i] = 0;
  }
  for (int i = 0; i < s1.length(); i++) {
    numbers1[s1[i]]++;
  }
  for (int i = 0; i < s2.length(); i++) {
    numbers2[s2[i]]++;
  }
  for (int i = 0; i < 200; i++) {
    if (numbers1[i] <= numbers2[i]) {
      yay = yay + numbers1[i];
      numbers2[i] = numbers2[i] - numbers1[i];
      numbers1[i] = 0;
    } else {
      numbers1[i] = numbers1[i] - numbers2[i];
      yay = yay + numbers2[i];
      numbers2[i] = 0;
    }
  }
  for (int i = 'a'; i <= 'z'; i++) {
    if (numbers1[i] == 0)
      continue;
    else {
      if (numbers2[i + 'A' - 'a'] >= numbers1[i]) {
        whoops = whoops + numbers1[i];
        numbers1[i] = 0;
      } else {
        whoops = whoops + numbers2[i + 'A' - 'a'];
        numbers2[i + 'A' - 'a'] = 0;
      }
    }
  }
  for (int i = 'A'; i <= 'Z'; i++) {
    if (numbers1[i] == 0)
      continue;
    else {
      if (numbers2[i + 'a' - 'A'] >= numbers1[i]) {
        whoops = whoops + numbers1[i];
        numbers1[i] = 0;
      } else {
        whoops = whoops + numbers2[i + 'a' - 'A'];
        numbers2[i + 'a' - 'A'] = 0;
      }
    }
  }
  cout << yay << " " << whoops;
}
