#include <bits/stdc++.h>
using namespace std;
const int M = 2e5 + 1;
int vis[M], vis2[M];
int main() {
  string t, s;
  cin >> s >> t;
  int a = 0, b = 0;
  for (char c : t) vis[c]++;
  int i = 0;
  for (char c : s) {
    if (vis[c]) {
      vis[c]--;
      a++;
      vis2[i] = 1;
    }
    i++;
  }
  for (i = 0; i < s.size(); i++) {
    if (vis2[i]) continue;
    char c = s[i];
    if (islower(c))
      c = toupper(c);
    else
      c = tolower(c);
    if (vis[c]) b++, vis[c]--;
  }
  cout << a << ' ' << b;
}
