#include <bits/stdc++.h>
using namespace std;
int freq[26], freq2[26], Freq[26], Freq2[26], YAY = 0, WHOOPS = 0;
int main() {
  string s, t;
  cin >> s >> t;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] >= 97)
      freq[s[i] - 'a']++;
    else
      Freq[s[i] - 'A']++;
  }
  for (int i = 0; i < t.length(); i++) {
    if (t[i] >= 97)
      freq2[t[i] - 'a']++;
    else
      Freq2[t[i] - 'A']++;
  }
  for (int i = 0; i < 26; i++) {
    int a = min(freq[i], freq2[i]);
    YAY += a;
    freq[i] -= a;
    freq2[i] -= a;
    a = min(Freq[i], Freq2[i]);
    YAY += a;
    Freq2[i] -= a;
    Freq[i] -= a;
    a = min(Freq[i], freq2[i]);
    WHOOPS += a;
    Freq[i] -= a;
    freq2[i] -= a;
    a = min(freq[i], Freq2[i]);
    WHOOPS += a;
    Freq2[i] -= a;
    freq[i] -= a;
  }
  cout << YAY << " " << WHOOPS;
  return 0;
}
