#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-11;
const double PI = 2 * acos(0.0);
using ll = long long;
using ull = unsigned long long;
int f[200];
int main() {
  string s, t;
  cin >> s >> t;
  for (auto c : t) f[(int)c]++;
  int first = 0, second = 0;
  string temp = "";
  for (auto item : s) {
    if (f[(int)item] > 0) {
      f[(int)item]--;
      first++;
    } else
      temp += item;
  }
  for (auto item : temp) {
    char ch = item;
    if (islower(ch)) {
      ch = toupper(ch);
      if (f[(int)ch] > 0) f[(int)ch]--, second++;
    } else {
      ch = tolower(ch);
      if (f[(int)ch] > 0) f[(int)ch]--, second++;
    }
  }
  cout << first << " " << second << endl;
  return 0;
}
